What 137 Means
When a process ends because of a signal, the shell and Docker report 128 plus the signal number. 137 minus 128 is 9, SIGKILL. A process cannot catch or ignore SIGKILL, so it gets no chance to save data or close connections. Something outside the process sent it: the kernel's out-of-memory killer, Docker after a stop timeout, or a person or script.
| Code | Signal | Usual source |
|---|---|---|
137 | SIGKILL (9) | Memory kill, stop timeout |
143 | SIGTERM (15) | A normal stop request |
139 | SIGSEGV (11) | A crash in the program |
130 | SIGINT (2) | Ctrl+C |
Code 139 is covered in segmentation fault.
Check for an Out-of-Memory Kill
docker inspect --format '{{.State.OOMKilled}} {{.State.ExitCode}}' mycontainertrue 137 means the container went over its memory limit, or the host ran out of memory. Confirm it in the kernel log and look at current use:
sudo journalctl -k | grep -i -E 'killed process|out of memory'
docker stats --no-streamIf the flag is false but the code is 137, still read the kernel log before you rule out memory. In Kubernetes, kubectl describe pod shows the last state with the reason OOMKilled and exit code 137. How the kernel picks its victim is explained in OOM killer.
Other Causes
- A stop that ran too long:
docker stopanddocker compose downsend SIGTERM, wait for a grace period, then send SIGKILL. An application that ignores SIGTERM ends with 137 on every stop. - docker kill: sends SIGKILL unless you name another signal.
- A manual kill:
kill -9by a person, a script, or a monitoring tool. - The host ran out of memory: the kernel can pick a process inside a container even when that container has no limit of its own.
Fix Memory Kills
- Read the last log lines:
docker logs --tail 50 mycontainershows what the program did before it died. See docker logs. - Set a realistic limit:
docker run --memory 1g, or the memory limit in your Compose file, sized to the peak you measured withdocker stats. - Find a leak: memory that only grows over hours or days is a leak, not a limit that is too small.
- Tell the runtime about the limit: Java heap settings and the Node.js old-space size should stay below the container limit.
- Give the host room: a swap file softens memory peaks on small servers; see how to add a swap file. It is a cushion, not a cure for a leak.
Make Stops Clean
A process that handles SIGTERM can finish its work and exit with 0 or 143 instead of being killed. Check these points:
- Use the exec form of the start command,
CMD ["node", "server.js"], so your program is process 1 and receives the signal. The difference is explained in ENTRYPOINT vs CMD. - In an entrypoint script, start the program with
execon the last line, so the shell is replaced by your program instead of staying in between. - Or run the container with
--init, which adds a small init process that forwards signals. - Handle SIGTERM in the application: stop accepting work, finish or save what is running, then exit.
- If shutdown needs more time, raise the grace period:
docker stop -t 30 mycontainer, orstop_in Compose.grace_ period
Processes Outside Docker
The same number appears for ordinary processes. A shell prints "Killed" and echo $? returns 137. For a systemd service, systemctl status app shows that it was killed with signal 9, and journalctl -u app shows the lines before it. systemd also sends SIGKILL when a service does not stop within its stop timeout.
Quick Checklist
- Run docker inspect for the OOMKilled flag and the exit code.
- Search the kernel log for an out-of-memory entry at the same time.
- Compare memory use with the limit in
docker stats. - If memory is fine, check whether the kill came during a stop or a deploy.
- Fix the limit, the leak, or the signal handling, then watch the next restart.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations