Sobes.tech
Junior — Middle

What criteria does the Linux OOM Killer use to select a process for termination?

sobes.tech AI

Answer from AI

The Linux OOM Killer selects a process to terminate based on several criteria to free memory and maintain system operation:

  • Memory consumed by the process — processes that use the most memory are more likely to be killed.
  • OOM score (process score) — calculated based on memory usage and process priority.
  • Process priority (nice value) — processes with lower priority are more likely to be chosen.
  • Importance of the process to the system — system processes and high-priority processes are usually protected.

Thus, the OOM Killer tries to terminate the process that frees the most memory with minimal damage to the system.