Exit Code 137 means a process was terminated immediately by Linux signal SIGKILL (128 + 9 = 137). In Kubernetes, this almost always points to one of two memory failures: container-level OOMKilled or node-level Evicted.
OOMKilled vs Evicted: How to Tell the Difference
OOMKilled(cgroup limit hit): Your container allocated more memory than its ownresources.limits.memory. The Linux kernel OOM killer terminates it immediately, andkubectl describe podshowsReason: OOMKilled.Evicted(node memory pressure): Even if your Pod stayed under its own limit, the underlying worker node ran out of total RAM. Thekubeletevicts Pods based on their QoS Class (BestEffortfirst, thenBurstable).livenessProbe/ Graceful Timeout SIGKILL: Rarely, exit code 137 occurs when a container ignoresSIGTERMduring shutdown and gets force-killed afterterminationGracePeriodSeconds.
30-Second kubectl Diagnosis
# Check container termination reason & QoS class kubectl get pod -o jsonpath='{.status.qosClass}{"n"}{.status.containerStatuses[0].lastState.terminated.reason}{"n"}' # Inspect kernel OOM messages on the node (if SSH/node access available) kubectl get events -A --field-selector reason=OOMKilling --sort-by='.lastTimestamp' How to Prevent Exit Code 137 Permanently
Leave 25%–30% Non-Heap Headroom for JVM/Go/Node: Never set Java
-Xmxequal to the container memory limit. Account for Metaspace, thread stacks, and direct buffers using our JVM Container Memory Calculator.Upgrade Critical Pods to
GuaranteedQoS: Set CPU and Memoryrequests == limitson every container so critical services are evicted last during node pressure. Test your config with the Kubernetes QoS Class Checker.Enable Memory Profiling Before Raising Limits Blindly: For Java services, follow our Native Memory Tracking (NMT) guide to pinpoint whether Heap, Direct Memory, or Threads caused the spike.
Originally published at OpsHubs. Found it useful? Buy us a coffee ☕.