Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default oom_adj value in Linux's OOM killer

I am trying to understand the default values of oom_adj for the processes of a Linux system (Fedora 15/16, to be precise). What I'm seeing is that a bunch of processes are set to -17, i.e., don't-kill, while others have different values (usually 0, sometimes -13). Somewhat counter-intuitively, it looks as though user processes use -17 more than system processes. Can anyone shed light on this? Am I missing a config file somewhere? Thanks!

like image 795
Christian Avatar asked Feb 19 '23 08:02

Christian


1 Answers

Unless you specifically set it, it will default to the value of the process it was forked from. Some processes, like openssh, explicitly change the value in their executable. The rational for openssh is that when you are in a low-memory condition you want to be able to ssh into the computer and kill some processes. For the reasons behind other executables setting their value differently, you'd have to ask their individual developers.

Because processes inherit the oom settings from their parents, if you launch something from an ssh session it's going to default to -17. That's why some processes may seem unreasonably important. However, keep in mind that computers exist to run processes for their users. If I'm working on an important paper and the memory starts to run low, the most important process on that machine at that moment is the one running my word processor. The whole reason the oom settings exist is to be able to communicate that importance to the operating system.

like image 199
Karl Bielefeldt Avatar answered Feb 28 '23 03:02

Karl Bielefeldt