$linuxjunkies
>

OOM killer

also: OOM, out-of-memory killer

A kernel mechanism that forcibly terminates processes when the system runs critically low on memory to prevent a complete system crash.

The Out-Of-Memory (OOM) killer is a last-resort safety feature in the Linux kernel that activates when available memory becomes critically depleted. Rather than allowing the entire system to freeze or crash, the kernel selects and kills one or more processes to free up RAM and restore stability.

The kernel uses a scoring algorithm to choose which process to terminate. Processes are ranked by memory usage, age, and priority—typically selecting memory hogs or less critical tasks. You can influence this behavior with the oom_score_adj parameter to protect important processes.

Example: If a runaway application allocates memory indefinitely, the OOM killer might terminate it automatically. System administrators can monitor this in /var/log/syslog or dmesg output, which logs messages like "Killed process 1234 (myapp) total-vm:2048000kB."

While essential for preventing system hangs, the OOM killer is unpredictable and considered a band-aid solution. Better practices include setting memory limits with cgroups, configuring swap space, or implementing proper resource management.

Related terms