Interview Prep/Linux/Storage & Memory

What is the OOM killer and how does it pick a victim?

IntermediateConceptStorage & Memory
Answer

When the kernel cannot reclaim enough memory to satisfy an allocation, the OOM killer kills a process to free memory. It scores each process (/proc/<pid>/oom_score) mainly on memory footprint (RSS + swap + page tables), adjusted by oom_score_adj (-1000 to 1000). The highest score is killed with SIGKILL.

dmesg -T | grep -i 'killed process'
journalctl -k | grep -i oom
All Linux questions Roadmap: Linux

More on Storage & Memory