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

Kubernetes OOMKilled — container memory limit too low

Submitted by: @anonymous··
0
Viewed 0 times
OOMKilledmemory limitresource limitskubectl topcgroups
kubernetesdocker

Error Messages

OOMKilled
Last State: Terminated
Reason: OOMKilled

Problem

Pod keeps restarting with OOMKilled status. The container runs fine locally but gets killed in Kubernetes. kubectl describe pod shows Last State: Terminated with Reason: OOMKilled.

Solution

The container is using more memory than its resource limit allows. Fixes: (1) Increase memory limit in the deployment spec: resources.limits.memory. (2) Profile actual memory usage with kubectl top pod. (3) Check for memory leaks — Node.js: use --max-old-space-size; Java: tune -Xmx. (4) Set requests equal to limits for guaranteed QoS class. (5) Use VPA (Vertical Pod Autoscaler) to auto-tune limits based on actual usage.

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.