Enable OOM-killer for cgroups

This commit is contained in:
Jagger 2016-06-19 18:40:16 +02:00
parent 3e91d44145
commit 8907d06693

View File

@ -63,9 +63,12 @@ bool cgroupInitNsFromParent(struct nsjconf_t *nsjconf, pid_t pid)
}
}
/*
* Use OOM-killer instead of making processes hang/sleep
*/
snprintf(fname, sizeof(fname), "%s/memory.oom_control", mem_cgroup_path);
LOG_D("Writting '1' '%s'", fname);
if (utilWriteBufToFile(fname, "1", strlen("1"), O_WRONLY) == false) {
if (utilWriteBufToFile(fname, "0", strlen("0"), O_WRONLY) == false) {
LOG_E("Could not update memory cgroup oom control");
return false;
}