Fix Exit Code 137 OOMKilled in Linux and Kubernetes
A process hits an exit code 137 oomkilled when killed by SIGKILL due to resource limits. Fix this in Kubernetes by matching memory requests and limits to peak usage. The Linux kernel OOM killer usually terminates the container for exceeding cgroup limits, though administrators can also issue the signal.
This article explains what exit code 137 and OOMKilled mean in Linux and Kubernetes environments. It covers how to inspect memory usage, update deployment configurations, and identify when an external actor initiates the termination.
What is exit code 137?
Exit code 137 signifies that a process was killed with SIGKILL (signal 9), which it cannot catch, block, or ignore. When you see this code in your shell or container logs, it means the operating system or runtime abruptly stopped your program because it ran out of resources or violated a resource constraint.

Many people mistakenly believe exit code 137 always means OOMKilled. It only indicates a SIGKILL, and the OOM killer is just one possible sender. A process manager or container runtime can also issue SIGKILL, for instance, if a process ignores a preceding SIGTERM signal too long during shutdown.
What does OOMKilled mean?
Kubernetes and containerized environments report OOMKilled when the Linux kernel’s Out-Of-Memory (OOM) killer terminates a container for exceeding its cgroup memory limit. Memory consumption exceeds this defined boundary and pressure detects, causing the Linux kernel to send SIGKILL. [kubernetes.io]
Kubernetes surfaces this condition as Reason: OOMKilled and Exit Code: 137 in the pod status. You can view these details by inspecting the pod configuration or running diagnostic commands against your cluster.
How to fix OOMKilled in Kubernetes
Align your container’s memory requests and limits with its actual peak usage patterns to fix OOMKilled errors in Kubernetes. A low memory request does not itself trigger a kernel kill, but hitting a strict memory limit during heavy traffic spikes can cause the kernel to terminate a container. [v1-32.docs.kubernetes.io]

- Run
kubectl top pod <pod> --containersto inspect the current memory usage of each container running inside your problem pod. - Compare the observed usage against the memory limits defined in your deployment YAML manifest file.
- Update the
resources.limits.memoryandresources.requests.memoryvalues in your deployment configuration to give the application enough headroom. - Apply the updated configuration file to your cluster using
kubectl apply -f deployment.yaml. - Verify that the restart count stops climbing and the pod remains in a running state by observing
kubectl get pods.
Why does exit code 137 happen without OOMKilled?
Exit code 137 can occur without an OOMKilled status if an external system, CI runner, or script explicitly sends a SIGKILL signal to the process. For instance, automated test runners often kill test subprocesses that exceed strict wall-clock time limits or resource thresholds.

Another common cause is manual intervention where an administrator runs a kill command targeting the process ID. Always check your application logs and orchestration event history. Doing this helps determine whether the kernel or an external actor initiated the termination.
Related guides
Frequently asked questions
What does exit code 137 mean in Docker?
Docker indicates exit code 137 when the Linux kernel forcibly stops the container process using signal 9. This usually happens when the container exceeds the memory limit specified at startup.
How do I check if my pod was OOMKilled?
You can verify an out-of-memory termination by running kubectl describe pod. Look for the OOMKilled status and exit code 137 in the container state history.
How do I calculate the right memory limit?
Base your container memory requests on the 95th percentile of actual working set bytes. Observe them over a representative seven-day operational period rather than peak instantaneous spikes.