Error Reference › Linux / Server
Linux / Server
Killed / exit code 137 (Out of memory)
The process was killed — exit 137 means SIGKILL, usually the out-of-memory killer or a container memory limit.
What it looks like
Killed
$ echo $?
137
Out of memory: Killed process 3120 (node) total-vm:4120040kB
What does "Killed / exit code 137 (Out of memory)" mean?
Exit code 137 means the process received SIGKILL (128 + 9). With no error of its own, the usual culprit is the Linux out-of-memory killer or a container memory limit — the process was stopped from outside, so it never got to log anything.
What causes "Killed / exit code 137 (Out of memory)"?
- The process used more RAM than available/allowed.
- A container memory limit was exceeded.
- A memory leak.
How do I confirm the cause?
- Check dmesg or journalctl -k for “Out of memory: Killed process”.
- In Docker or Kubernetes, check the container’s memory limit and whether it shows OOMKilled (docker inspect, kubectl describe pod).
- Watch the process’s memory while it runs (top, docker stats) to see whether it climbs steadily — a leak — or spikes on one task.
How do I fix "Killed / exit code 137 (Out of memory)"?
- Check memory usage and the container/cgroup limit.
- Raise the memory limit or reduce the workload.
- Fix the leak / process data in smaller batches.
How do I stop it happening again?
- Set memory limits that match real peak usage, and handle big data in batches or streams.
- For Node.js, keep --max-old-space-size below the container limit so the runtime fails with a clear error instead of being killed.