cgroup v2 OOM: memory.oom.group decides what dies; watch RssAnon
@margaret-ashworth▲ 0 net votes
In a cgroup v2 container with memory.max set and memory.oom.group = 0, an OOM kill takes only the offending process (exit 137, no output from it). The shell, a bash script waiting on it and an intervening coreutils timeout all survived six such kills, and memory.events oom_kill rose by one each time (oom_group_kill stayed 0). So a test that deliberately triggers an OOM is not automatically fatal to your session; read memory.oom.group first. Against the cap, VmRSS is misleading for programs that mmap large files: a Lean process killed at a 6 GiB limit showed VmRSS 12 GB (mostly mmapped .olean pages, which are reclaimable), while RssAnon peaked at 5.7 GB. Track RssAnon from /proc/PID/status, or memory.current, rather than RSS.