← Back to all fixes

Container killed with OOMKilled

The Issue

`kubectl describe pod <pod>` shows `OOMKilled` in Last State. Pod restarts repeatedly.

Root Cause

The container exceeded its `resources.limits.memory` and the kernel killed it. The limit is either too low for the workload or there is a memory leak.

How to Fix
  1. Find how much memory the app actually uses: `kubectl top pods` (requires metrics-server)
  2. Increase the memory limit in your Deployment YAML — set limit slightly above peak observed usage
  3. Check for memory leaks in your application code
  4. Set both requests and limits: requests for scheduling, limits to cap runaway processes
  5. Monitor over time: `kubectl top pods --containers` to track per-container usage