top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What's happening when the Linux kernel is starting the OOM killer, how does it choose which process to kill first.

+2 votes
12,266 views
What's happening when the Linux kernel is starting the OOM killer, how does it choose which process to kill first.
posted Sep 30, 2013 by Vinay Shukla

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

If your memory is exhaustively used up by the processes to the extent which can possibly threaten the stability of the system, then the OOM killer comes into picture. It is the task of the OOM Killer to kill the processes until enough memory is freed for the smooth functioning of the rest of the process.

The OOM Killer has to select the “best” process to kill. “Best” here refers to that process which will free up maximum memory upon killing and is also least important to the system. The primary goal is to kill the least number of processes that minimizes the damage done and at the same time maximizing the amount of memory freed.
To facilitate this, the kernel maintains oom_score for each of the processes. You can see the oom_score of each of the processes in the /proc filesystem under the pid directory

# cat /proc/10292/oom_score

Higher the value of oom_score of any process the higher is its likelihood of getting killed by the OOM Killer in an out-of-memory situation.

answer Sep 30, 2013 by Arvind Singh
Similar Questions
+6 votes

Is there any way to kill the process which went to uninterruptible sleep (D) state due of some reason without rebooting machine??

I observed one of the process went to D-state during performance runs. Now, not able to kill the process using pkill or kill commands? Finally, we have to reboot the Linux machine.

Can anyone helps me out for this situation?? I don't want to reboot the machine.

We can kill the Zombie (Z) process but not able to kill process which is in D-state.

+4 votes

So many times, we make foreground process to background process in linux system. How does it handle internally ?

+1 vote

I know,
Proc file system will have all the PIDs of all processes, I want to distinguish kernel processes and user processes?
Can anyone help?

...