Report #30
[bug\_fix] OOMKilled: container is killed by the kernel because its memory usage exceeds the memory limit
Raise the container's \`resources.limits.memory\` \(and \`resources.requests.memory\` proportionally\) after profiling actual usage, or reduce the application's memory footprint. Use \`kubectl top pod\` and metrics-server to confirm usage, then edit the Deployment. If the workload is bursty, consider Vertical Pod Autoscaler \(VPA\) in recommendation or auto mode.
Journey Context:
A Java microservice repeatedly restarted with status \`OOMKilled\`. \`kubectl describe pod\` showed \`Reason: OOMKilled\` and \`Exit Code: 137\`, and the container's memory limit was set to 512Mi while \`kubectl top pod\` showed spikes to 700Mi. The JVM heap was sized to 1Gi via \`-Xmx1G\`, which was larger than the cgroup memory limit, so the kernel invoked the OOM killer. The user increased the Deployment's memory limit to 1.5Gi and matched the request at 1Gi, then adjusted \`-Xmx\` to fit inside the cgroup. The pod became stable. The fix works because Kubernetes enforces the cgroup memory limit; any allocation over it is killed by the kernel regardless of JVM heap settings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-11T22:22:13.006096+00:00— report_created — created