FULL AI ANALYSIS

Kubernetes pods OOM-killed despite plentiful node memory due to cgroup v2 memory.high vs kubelet eviction mismatch

Generated Oct 29, 2026, 9:46:59 AM

Analysis summary

With cgroup v2 the kernel enforces memory.high and memory.max per-cgroup; when a container exceeds memory.high the kernel may throttle and if memory.max is hit it will kill processes. Kubelet's eviction logic operates at node level (memory.available, pressure) and may not catch per-cgroup enforcement. Causes include too-tight container memory limits, memory.high defaulting to limit or being derived from limit, or kernel-level cgroup settings (e.g., memory.swap.max) enforcing kills before kubelet can respond. Also pod workloads may burst above set limits (worker threads, native libraries).

Possible causes

Per-cgroup memory.high or memory.max set too low relative to workload bursts, causing kernel to kill or throttle before kubelet evictions trigger.

85%

Kubelet eviction thresholds configured only at node level; mismatch with cgroup v2 enforcement semantics leading to race between kernel and kubelet.

70%

Application memory spikes (native allocations, thread stacks) exceed container memory limits unexpectedly; limits too tight.

60%

Container runtime/kubelet bug in cgroup v2 handling leading to incorrect memory.high calculation.

30%

Suggested fixes

1

Diagnostic step 1

Reproduce under controlled load and monitor per-cgroup metrics: cat memory.current and memory.high in /sys/fs/cgroup/<kubepods>/... for affected pod cgroups.

2

Diagnostic step 2

Increase pod memory limits (and requests) to accommodate peak allocations, test workload; prefer headroom for native/library spikes.

3

Diagnostic step 3

Adjust kubelet eviction thresholds to be more aggressive earlier (e.g., higher memory.available watermark) so kubelet can evict before kernel kills. Test changes on one node first.

4

Diagnostic step 4

Consider setting memory.swap.max or tune memory.low/high as appropriate for cgroup v2; avoid disabling kernel enforcement globally. If using systemd, check system.slice cgroup defaults.

5

Diagnostic step 5

If behavior persists, collect kubelet/containerd logs and /proc/kmsg and escalate to cluster ops with cgroup v2 debug traces for deeper kernel-runtime investigation.