OOMKilled (exit code 137): what it means and how to fix it
128 + 9 — the process got SIGKILL. In Docker and Kubernetes this almost always means the container exceeded its memory limit and the kernel out-of-memory killer terminated it.What causes OOMKilled (exit 137)
A memory limit set too low for normal peak load; a genuine memory leak; a traffic spike; loading a large file or dataset entirely into memory; or a JVM/Node heap larger than the container limit.
How to diagnose it
In Kubernetes run kubectl describe pod <pod> and look under Last State for Reason: OOMKilled, Exit Code: 137. In Docker, docker inspect <id> --format '{{.State.OOMKilled}}' returns true. Then check whether memory climbs steadily (leak) or spikes (load).
How to fix OOMKilled (exit 137)
- Confirm it was OOM. Verify Reason: OOMKilled and exit 137 — 137 can also be a manual SIGKILL.
- Raise the limit or fix the leak. If usage is reasonable but the limit is low, raise
resources.limits.memory. If memory grows without bound, profile and fix the leak. - Set requests = limits with headroom. Give the container a realistic request/limit ~20–30% above observed peak, and set the runtime heap (
-Xmx,--max-old-space-size) below the container limit.
Example log line
State: Terminated Reason: OOMKilled Exit Code: 137
kernel: Memory cgroup out of memory: Killed process 4821 (java)
How LogLens detects OOMKilled (exit 137)
LogLens recognises the OOMKilled keyword and the repeated container-restart pattern, and groups them into one incident. LogLens AI is a free, self-hosted AI log analyzer that surfaces lines like this automatically, groups them into one incident, and explains them in plain language.
Related errors
FAQ
What does exit code 137 mean?
137 = 128 + 9, meaning the process received SIGKILL (signal 9). In containers it is almost always the OOM killer acting because the memory limit was exceeded.
Is OOMKilled always a memory leak?
No — it is often simply a limit set too low for peak usage, a spike, or a large in-memory operation. Check the memory trend before assuming a leak.