Docker Exit Code 137: OOMKilled, Explained

Symptom

docker ps -a shows Exited (137); dmesg shows oom-kill.

Root cause

The kernel OOM killer stopped the container (or docker stop timed out).

Fix, in order

1. Confirm OOM as the causedmesg | grep -i "killed process"
2. Find the real memory footprintdocker stats --no-stream
3. Raise the host memory or the container limitdocker run -m 1g ...
4. Check for leaks: RSS should plateau, not climbwhile true; do ps -o rss= -p <pid>; sleep 5; done

Prevent it coming back

Set memory limits deliberately and alert at 80% of the limit, not at the crash.

Deep-dive article

Full walkthrough: Docker Exit Code 137: OOMKilled, Explained on the NinjaOps blog.

Run it on clean infra

Spinning up a fresh box to reproduce or escape this error?

Servers with headroom

Related

Cloud & DevOps tool comparisons · Hardware build guides

NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.

Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog