Junior — Middle
In what cases does the OOM Killer mechanism in Linux get triggered to terminate processes?
sobes.tech AI
Answer from AI
OOM Killer (Out-Of-Memory Killer) in Linux is triggered when the system runs out of free RAM and swap space to satisfy memory allocation requests. This occurs in situations where:
- All available memory pages are occupied.
- Swap space is fully used or absent.
- The system cannot free memory through standard mechanisms (e.g., cache cleaning).
In such cases, the kernel selects one or more processes for forced termination to free up memory and maintain system stability. The process selection is based on various criteria, including memory consumption, process priority, and runtime.
Thus, OOM Killer is an extreme measure to prevent the system from completely freezing due to memory shortage.