diff --git a/config-linux.md b/config-linux.md index e3d4100ab..f0de3200b 100644 --- a/config-linux.md +++ b/config-linux.md @@ -275,6 +275,8 @@ The following properties do not specify memory limits, but are covered by the `m If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer. The OOM killer is enabled by default in every cgroup using the `memory` subsystem. To disable it, specify a value of `true`. +* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting. + If enabled (`true`), child cgroups will share the memory limits of this cgroup. #### Example diff --git a/schema/config-linux.json b/schema/config-linux.json index 5a3fd50e1..f83b8ac53 100644 --- a/schema/config-linux.json +++ b/schema/config-linux.json @@ -159,6 +159,9 @@ }, "disableOOMKiller": { "type": "boolean" + }, + "useHierarchy": { + "type": "boolean" } } }, diff --git a/schema/test/config/good/spec-example.json b/schema/test/config/good/spec-example.json index c1390c379..a239faeed 100644 --- a/schema/test/config/good/spec-example.json +++ b/schema/test/config/good/spec-example.json @@ -242,7 +242,8 @@ "kernel": -1, "kernelTCP": -1, "swappiness": 0, - "disableOOMKiller": false + "disableOOMKiller": false, + "useHierarchy": false }, "cpu": { "shares": 1024, diff --git a/specs-go/config.go b/specs-go/config.go index 7781c5361..fd7cc13ad 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -288,6 +288,8 @@ type LinuxMemory struct { Swappiness *uint64 `json:"swappiness,omitempty"` // DisableOOMKiller disables the OOM killer for out of memory conditions DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"` + // Enables hierarchical memory accounting + UseHierarchy *bool `json:"useHierarchy,omitempty"` } // LinuxCPU for Linux cgroup 'cpu' resource management