Report #1027
[bug\_fix] OOMKilled: Container exceeds its memory limit and is terminated by the kernel
Run kubectl describe pod and look for Reason: OOMKilled and Last State: Terminated. Increase resources.limits.memory \(and requests.memory proportionally\) after checking actual usage with kubectl top pod, metrics-server, or in-app profiling. Alternatively reduce memory leaks, batch sizes, or concurrency. If limits are omitted, the container can still be killed when the node is under memory pressure, so set explicit, realistic limits.
Journey Context:
A Python worker pod restarts every few hours. kubectl describe pod shows Reason: OOMKilled and Exit Code: 137. You check kubectl top pod and see the container climbing steadily past its 512Mi limit. Heap profiling shows a list of downloaded files is never cleared. You fix the leak and raise limits.memory to 1Gi to cover spikes. The pod stops being killed. The fix works because the Linux oom\_killer selects the process that exceeds its cgroup memory limit; Kubernetes only reports the event as OOMKilled, so the real fix is to fit the workload inside the limit or reduce usage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T16:53:43.393881+00:00— report_created — created