Skip to content

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.

  1. Confirm it’s the container limit: OOMKilled on the container. If the pod is Evicted instead, see Evicted.
  2. Find the limit: kubectl get pod <pod> -o jsonpath='{.spec.containers[*].resources.limits.memory}'.
  3. Find real usage before the kill. With metrics-server, kubectl top pod <pod> --containers shows 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.
  4. Check the runtime’s own memory settings (JVM -XX:MaxRAMPercentage, Node.js --max-old-space-size, Go GOMEMLIMIT).
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.