Docker Exit Code 137 Explained: Causes, Diagnosis, and Fixes for OOMKilled
Docker containers displaying exit code 137 have been forcibly terminated via SIGKILL, most commonly triggered by the Linux kernel's Out-Of-Memory (OOM) killer when a container exceeds its memory limit or the host runs out of RAM. The exit code itself combines the shell convention of 128 plus signal number 9 (SIGKILL), and can also result from a timed-out docker stop command, making the two causes visually identical in docker ps output. Developers can confirm OOM involvement by running docker inspect and checking the OOMKilled flag, or by reviewing kernel logs via dmesg or journalctl for explicit kill entries. Common root causes include absent memory limits, undersized cgroup caps, genuine memory leaks, and runtime environments like older JVMs or Node.js that size their heap based on total host RAM rather than container limits. Addressing the issue typically starts with monitoring live memory usage via docker stats and progressively applying fixes such as setting appropriate memory limits and configuring runtime-aware heap settings.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in