Merge pull request #97 from hqhq/hq_add_oom_kill_disable

Add oom-kill-disable support for systemd
This commit is contained in:
Mrunal Patel
2015-07-08 09:40:08 -07:00
@@ -505,6 +505,11 @@ func joinMemory(c *configs.Cgroup, pid int) error {
return err
}
}
if c.OomKillDisable {
if err := writeFile(path, "memory.oom_control", "1"); err != nil {
return err
}
}
if c.MemorySwappiness >= 0 && c.MemorySwappiness <= 100 {
err = writeFile(path, "memory.swappiness", strconv.FormatInt(c.MemorySwappiness, 10))