MCPcopy Create free account
hub / github.com/F-Stack/f-stack / readOOMScoreAdj

Function readOOMScoreAdj

app/redis-6.2.6/src/server.c:2846–2856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2844}
2845
2846static void readOOMScoreAdj(void) {
2847#ifdef HAVE_PROC_OOM_SCORE_ADJ
2848 char buf[64];
2849 int fd = open("/proc/self/oom_score_adj", O_RDONLY);
2850
2851 if (fd < 0) return;
2852 if (read(fd, buf, sizeof(buf)) > 0)
2853 server.oom_score_adj_base = atoi(buf);
2854 close(fd);
2855#endif
2856}
2857
2858/* This function will configure the current process's oom_score_adj according
2859 * to user specified configuration. This is currently implemented on Linux

Callers 1

mainFunction · 0.85

Calls 2

readFunction · 0.70
closeFunction · 0.70

Tested by

no test coverage detected