Diagnostic step 1
Inspect cgroup metrics during reproduction: watch memory.current, memory.max, memory.high, memory.stat in the container's cgroup directory (e.g., sudo cat /sys/fs/cgroup/<cgroup>/memory.current) to correlate spikes with kills.
Generated Oct 17, 2026, 9:26:11 AM
Inspect cgroup metrics during reproduction: watch memory.current, memory.max, memory.high, memory.stat in the container's cgroup directory (e.g., sudo cat /sys/fs/cgroup/<cgroup>/memory.current) to correlate spikes with kills.
Temporarily enable a small swapfile on the host (reversible): fallocate -l 4G /swapfile; chmod 600 /swapfile; mkswap /swapfile; sudo swapon /swapfile — then rerun workload to see if kills stop. If swap reduces kills, kernel reclaim was the limiting factor.
Experiment with raising container --memory and also set memory.swapiness and memory.high via Docker/cgroup settings to allow controlled burstable memory. For example, increase --memory and set --memory-reservation to allow soft bursts.
If safe to modify workload, instrument application memory allocations to avoid large instantaneous allocations; use jemalloc or tune allocator to smooth spikes.
If cgroup behavior is unclear, reproduce on a non-cgroup-v2 test host (or with cgroup v1 if possible) to confirm difference; escalate to kernel/distribution maintainers if memory.stat shows unexpected behavior or if dmesg indicates kernel reclaim bugs. Preserve logs and avoid exposing application sensitive data when escalating.