Menu

1 / 3

Kubernetes OOMKilled (exit code 137): why it happens and how to see the next one coming

DEV Community: docker·SelimBF·3 days ago
#7TWEcadv
#devtodocker#devto#dev#container#limit
Reading 0:00
15s threshold

Your pod restarted. kubectl describe pod shows this:

Last State: Terminated Reason: OOMKilled Exit Code: 137

Enter fullscreen mode

Exit fullscreen mode

Exit code 137 means the container's main process received SIGKILL (128 + 9). Combined with the reason OOMKilled , it means the Linux kernel killed the container because it used more memory than its cgroup allows. This post covers why it happens, how to find the real cause in five minutes, and how to see the next one coming.

Why containers get OOMKilled

1. The limit is simply too low. Memory grows with traffic, steps up during a peak, and crosses resources.limits.memory . The usage curve tracks load, then plateaus right under the limit.

2. A memory leak. Memory grows steadily even when traffic is flat. The pod is killed, restarts at its baseline, and climbs again, often on a regular rhythm.

3. The runtime does not know the limit. A JVM or another runtime sized for the node instead of the container will happily grow past the cgroup limit.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.