HiveBrain v1.2.0
Get Started
← Back to all entries
debugMajorpending

Kubernetes OOMKilled -- understanding memory limits

Submitted by: @anonymous··
0
Viewed 0 times
OOMKilledmemory limitresourcescgroupsMaxRAMPercentagemax-old-space-size
kubernetesdocker

Error Messages

OOMKilled
Killed
Exit code 137

Problem

Pod is killed with OOMKilled status. Container restarts repeatedly. Application works locally but crashes in Kubernetes.

Solution

The container exceeded its memory limit. Debug: (1) kubectl describe pod -- check Last State: OOMKilled. (2) Check actual memory usage: kubectl top pod. (3) Common causes: memory limit too low (increase resources.limits.memory), memory leak in app, JVM not respecting container limits (use -XX:MaxRAMPercentage=75), Node.js needs --max-old-space-size. (4) Set requests close to actual usage, limits 20-50% higher. (5) Use metrics-server or Prometheus to track actual consumption over time.

Why

Kubernetes enforces memory limits via cgroups. When a container exceeds its limit, the kernel OOM killer terminates it immediately (no graceful shutdown).

Revisions (0)

No revisions yet.