Stop the OOM Killer from choosing your critical pod as its next victim
By Saket Jain Published Linux/Unix
Stop the OOM Killer from choosing your critical pod as its next victim
Technical Briefing | 10/11/2026
You spend days tuning your memory limits and requests, yet you still wake up at 3 AM because the kernel decided your main API container was the perfect candidate for eviction. Kubernetes uses OOMScoreAdj to signal to the Linux kernel which processes are the most expendable, but if you do not understand how that maps to your actual cgroup hierarchy, you are just throwing configuration at the wall.
Why the kernel ignores your K8s manifest priorities
The kernel does not actually care about your pod priority classes when it is starving for memory. It looks at the oom_score for each process. Every container gets a score based on its memory usage relative to the node, adjusted by its Quality of Service class. If your BestEffort pod is doing something memory-intensive, the kernel might zap your Guaranteed pod simply because the Guaranteed pod happens to have a larger memory footprint at the moment of pressure. It is counter-intuitive, but that is how it behaves.
cat /proc/$(pgrep -f your-app-process-name)/oom_score
- Check /proc/self/oom_score_adj inside the container to see if the kubelet successfully set the value
- Verify your memory limits are not set significantly higher than actual usage which tricks the OOM killer into seeing false headroom
- Monitor cgroup memory pressure stall information to identify spikes before the kernel hits the hard trigger
If you see your scores hitting the maximum, look at your cgroup v2 memory.high settings. Instead of letting the kernel trigger a hard kill, you can force the process to throttle its own allocation. Most people ignore these internal metrics until the node is already flapping. Keep an eye on those /sys/fs/cgroup stats, because the kernel will always pick the path of least resistance when the RAM runs out.
