Ensure panic_on_oom disabled

This commit is contained in:
derekwaynecarr
2015-10-09 15:39:30 -04:00
parent ed382ec0a0
commit 0ec36ae210
2 changed files with 49 additions and 19 deletions

View File

@@ -23,7 +23,14 @@ import (
"strings"
)
const sysctlBase = "/proc/sys"
const (
sysctlBase = "/proc/sys"
VmOvercommitMemory = "vm/overcommit_memory"
VmPanicOnOOM = "vm/panic_on_oom"
VmOvercommitMemoryAlways = 1 // kernel performs no memory over-commit handling
VmPanicOnOOMInvokeOOMKiller = 0 // kernel calls the oom_killer function when OOM occurs
)
// GetSysctl returns the value for the specified sysctl setting
func GetSysctl(sysctl string) (int, error) {