Report #99620
[bug\_fix] OOMKilled: container terminated by Linux OOM killer
Inspect \`kubectl describe pod\` for \`Last State: Terminated, Reason: OOMKilled, Exit Code: 137\`, then raise \`resources.limits.memory\` \(and usually \`requests.memory\`\) to cover the working set plus overhead, or reduce the application's memory footprint. For JVM workloads, set \`-XX:MaxRAMPercentage\` so the heap respects the container limit; for Node.js set \`--max-old-space-size\`. Verify with \`kubectl top pod\` and monitoring before and after the change.
Journey Context:
A Java microservice kept restarting. \`kubectl get pods\` showed \`OOMKilled\`, and \`kubectl describe pod\` reported exit code 137 \(128 \+ SIGKILL 9\). The pod spec had \`limits.memory: 512Mi\` but the JVM was starting with a default heap that ignored cgroup limits on an older base image. The container's working set \(heap \+ metaspace \+ native \+ thread stacks\) exceeded 512Mi, so the kernel OOM killer sent SIGKILL. The developer initially suspected a memory leak, but \`kubectl top pod\` showed a flat line near the limit followed by an immediate kill, not gradual growth. The fix was to bump the limit to 1Gi and add \`JAVA\_OPTS=-XX:\+UseContainerSupport -XX:MaxRAMPercentage=75.0\` so the JVM heap stayed within the container budget. After the rollout, restarts stopped and the memory graph stabilized below 80% of the limit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:46:47.920695+00:00— report_created — created