What is Linux Out-Of-Memory OOM Killer ?

Major distribution kernels set the default value of /proc/sys/vm/overcommit_memory to zero, which means that processes can request more memory than is currently free in the system. This is done based on the heuristics that allocated memory is not used immediately, and that processes, over their lifetime, also do not use all of the memory they allocate.

Without overcommit, a system will not fully utilise its memory, thus wasting some of it. Overcommiting memory allows the system to use the memory in a more efficient way, but at the risk of OOM situations.

Memory-hogging programs can deplete the system’s memory, bringing the whole system to a grinding halt. This can lead to a situation, when memory is so low, that even a single page cannot be allocated to a user process, to allow the administrator to kill an appropriate task, or to the kernel to carry out important operations such as freeing memory.

In such a situation, the OOM-killer kicks in and identifies the process to be the sacrificial lamb for the benefit of the rest of the system.

So, the OOM Killer or Out of Memory killer is a Linux kernel functionality ( refer to kernel source code mm/oom_kill.c ) which is executed only when the system starts going out of memory.

How to invoke OOM Killer manually for understanding which process gets killed first
For this, please refer to our post at How to invoke OOM Killer manually for understanding which process gets killed first

1 thought on “What is Linux Out-Of-Memory OOM Killer ?”

Leave a Comment