OOMKilled and Exit Code 137: Why Kubernetes Kills Your Pods and How to Stop It
Blog post from Cast AI
OOMKilled in Kubernetes refers to the termination of a container by the Linux kernel's Out-Of-Memory (OOM) killer due to exceeding its cgroup memory limit, resulting in exit code 137. This occurrence is reported by Kubernetes but is enforced by the Linux kernel. The scenarios leading to OOMKilled include a container exceeding its individual memory limit, node memory pressure causing kubelet eviction, and node-level kernel OOM events. Diagnosing and addressing OOMKilled involves inspecting container states and logs, setting appropriate memory requests and limits based on actual usage, and ensuring sufficient node memory headroom. While raising memory limits might offer a temporary solution, accurate per-container sizing and automated rightsizing are recommended for long-term prevention. Tools like Cast AI Workload Optimization can proactively adjust memory limits based on real-time data, reducing the frequency of OOM kills and optimizing resource allocation across clusters.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Kubernetes | 19 | 2,083 | 321 | 111 | +3% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.