OOMKilled
The kernel killed the container because it used more memory than its limit. The kubelet restarts it, so this usually appears as climbing restarts and, eventually, CrashLoopBackOff.
Diagnose in order
Section titled “Diagnose in order”- Confirm it’s the container limit:
OOMKilledon the container. If the pod isEvictedinstead, see Evicted. - Find the limit:
kubectl get pod <pod> -o jsonpath='{.spec.containers[*].resources.limits.memory}'. - Find real usage before the kill. With metrics-server,
kubectl top pod <pod> --containersshows current usage. Your monitoring’s memory graph for the previous hour is better: a sawtooth that climbs until each kill is a leak; a flat line just under the limit with spikes is a limit that’s too low. - Check the runtime’s own memory settings (JVM
-XX:MaxRAMPercentage, Node.js--max-old-space-size, GoGOMEMLIMIT).
Usual causes
Section titled “Usual causes”| Pattern | Cause |
|---|---|
| Killed at startup every time | Limit below the app’s baseline footprint |
| Killed under load | Limit sized for idle; concurrency or cache growth not accounted for |
| Usage climbs steadily, then killed | Memory leak |
| Runtime heap set larger than the limit | The runtime doesn’t know about the container limit |
Set the limit to measured peak plus headroom, make the runtime size itself from the container limit, or fix the leak. Raising the limit to stop a leak only delays the next kill.
Read next: Probes and resource limits.