concept Hosting
cgroup v2 memory.high versus memory.max
In Linux cgroup v2, memory.high puts a workload under reclaim and throttling pressure. At the hard limit, memory.max, the key question is whether reclaim can free enough memory for the attempted charge.
What it means
In Linux cgroup v2, memory.high is a threshold for slowing a workload down, not for killing it. Above memory.high, the kernel puts the cgroup's tasks under reclaim pressure: it tries to free memory and throttles tasks, so work can take longer. memory.max is the hard limit. If a new memory charge would exceed it and reclaim cannot free enough memory, the cgroup may encounter an out-of-memory (OOM) condition.
Try it
Simulation: start with memory.high at 512 MiB and memory.max at 1024 MiB. Treat Memory charged as the total the cgroup would be charged in this hypothetical example, not as a reading from your server.
cgroup v2 memory.high versus memory.max
Explain reclaim/throttle versus hard memory limit in a hosting workload
Above high but not max: reclaim/throttling pressure, not an automatic kill.
Enforcement
- Relevant excess88 MiB
- Reclaim outcomeNot evaluated
- Resultpressure
The charge is hypothetical. Above max, the excess is not a confirmed allocation or a confirmed OOM kill.
Evaluated inputs
- Required scenario evidence
- provided
- memory.high
- 512 MiB
- memory.max
- 1024 MiB
- Memory charged
- 600 MiB
Not evaluated: Reclaim outcome above max
Linux cgroup v2, finite thresholds ordered for this lab, hypothetical attempted charge, not exact reclaim algorithm or memory protection effects.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
- At 600 MiB, the charge is 88 MiB above
memory.highbut still belowmemory.max. The result is reclaim and throttling pressure. The selected reclaim outcome,insufficient, is not evaluated: it applies only abovememory.max. - Change the charge to 512 MiB. It is now exactly at
memory.high, not above it. Neither threshold is exceeded; the modeled excess is 0 MiB. - Set the charge to 1100 MiB. It would exceed
memory.maxby 76 MiB. Leave reclaim atinsufficientand the result is OOM risk, not a confirmed kill. Now change only reclaim tosufficient. The excess is still 76 MiB, but this time reclaim succeeds. Chooseunknownif all you know is the charge: the model can still calculate the excess but cannot say how enforcement ends.
Reset returns to 600 MiB, the original thresholds, insufficient reclaim and provided evidence. The simulation neither reads nor changes a live cgroup.
What the excess tells you
The two differences answer different questions. At 600 MiB, subtracting 512 MiB tells you how far usage is above the pressure threshold. It does not tell you how much memory the kernel will reclaim or how long a request will stall. At 1100 MiB, subtracting 1024 MiB tells you how far the attempted charge would go beyond the hard limit. It does not mean the workload was granted 76 MiB of extra capacity.
The comparison uses ordered finite thresholds. If you set both to 512 MiB, the example has no interval strictly above high but at or below max. A charge of 513 MiB goes straight to the modeled max enforcement question. Equal thresholds are permitted by this lab, not a recommendation for configuring a live workload.
The distinction matters at the boundary, too. With the same thresholds, a charge of exactly 1024 MiB is above memory.high but does not exceed memory.max. The simulation still reports pressure. It asks about reclaim success at the hard limit only when the attempted total would go beyond it.
In practice
For a hosted service, compare memory.current, memory.high and memory.max for the same cgroup, in the same units. memory.current accounts for the group and its descendants; one worker's resident memory is not a substitute. A reading above memory.high is consistent with reclaim pressure, but that reading alone does not show how much the service slowed down. For evidence of time spent stalled on memory, look at Linux Pressure Stall Information (PSI). PSI describes stalls, not memory usage or the value of a limit.
Nor does a limit value tell you what can be freed. On a real system, memory.min and memory.low affect reclaim protection, subject to the cgroup hierarchy. The simulation uses an assumed reclaim outcome rather than calculating which memory is protected or reclaimable.
Use the threshold to decide what evidence to seek: above memory.high, look for the effect of pressure on the workload. If a charge would exceed memory.max, look for the outcome of reclaim before concluding that the cgroup ran out of memory.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Is memory.high a hard cap?
No. memory.high creates reclaim and throttling pressure rather than a hard ceiling. The kernel documentation allows usage to exceed it.
Does exceeding max always kill?
No. The kernel attempts reclaim at the hard limit; if memory cannot be reclaimed sufficiently, OOM handling may occur. The example uses a stipulated reclaim outcome and reports risk, not an observed kill.
Is memory.current process RSS?
No, it is cgroup memory usage accounting.
Can protection affect reclaim?
Yes. memory.min and memory.low change the reclaim protection of eligible memory. Hierarchical limits and available reclaimable memory still matter.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Linux Control Group v2
memory.high, memory.max. memory.high introduces reclaim pressure and throttling; memory.max is a hard limit with reclaim and cgroup-local OOM behavior. Hierarchical accounting and protection matter.
Checked .
- Linux Pressure Stall Information
Pressure interface. Linux PSI memory pressure indicates time spent stalled on memory. This is different from reading current memory usage or an individual cgroup limit.
Checked .