LinuxMid

Process killed by the out-of-memory killer

When the kernel runs out of memory it kills processes. Confirm an OOM kill in the kernel log, then reduce memory use, add memory or set limits.

What you see

  • A process disappears with no error of its own
  • A container exits with code 137

What it means

If the kernel cannot find enough memory for important system functions it raises an out-of-memory condition and starts killing processes to free memory. The Docker docs warn that any process can be chosen, including Docker and other important applications, and that this can bring a whole system down.

How to confirm the cause

  1. 1
    Search the kernel log for OOM events
    journalctl -k -b | grep -i -e "out of memory" -e "oom"

    -k shows kernel messages only, -b limits to this boot. dmesg -T also works, and -T prints readable timestamps.

  2. 2
    Check current memory
    free -h

Causes and fixes

  • The host has too little memory for its workload

    HOW TO TELL
    OOM events appear when load is normal.
    FIX
    Run the workload on a host with enough memory, or spread it across hosts.
  • One process leaks or grows without bound

    HOW TO TELL
    The same process is the victim every time.
    FIX
    Fix the leak. For containers, set a memory limit so one container cannot starve the host (docker run --memory).

How to stop it coming back

  • Load test and measure memory needs before you place an app in production, as the Docker docs advise.
  • Set limits on containers and alert on memory use.

Keep going

Sources

Linux man-pages (man7.org) and the systemd manual (freedesktop.org), read 18 Nov 2026. Command options were checked against those pages.

Search

Search cheat sheets and projects