{
    "mode": "man",
    "parameter": "proc_pid_oom_adj",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/proc_pid_oom_adj/5/json",
    "generated": "2026-10-04T20:15:35Z",
    "sections": {
        "NAME": {
            "content": "/proc/pid/oomscoreadj - OOM-killer score adjustment\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "/proc/pid/oomscoreadj (since Linux 2.6.36)\nThis  file  can  be  used to adjust the badness heuristic used to select which process\ngets killed in out-of-memory conditions.\n\nThe badness heuristic assigns a value to each candidate task  ranging  from  0  (never\nkill)  to  1000  (always  kill) to determine which process is targeted.  The units are\nroughly a proportion along that range of allowed memory the process may allocate from,\nbased on an estimation of its current memory and swap use.  For example, if a task  is\nusing  all allowed memory, its badness score will be 1000.  If it is using half of its\nallowed memory, its score will be 500.\n\nThere is an additional factor included in the badness score: root processes are  given\n3% extra memory over other tasks.\n\nThe  amount  of  \"allowed\"  memory  depends on the context in which the OOM-killer was\ncalled.  If it is due to the memory assigned to the allocating task's cpuset being ex‐\nhausted, the allowed memory represents the set of mems assigned to  that  cpuset  (see\ncpuset(7)).  If it is due to a mempolicy's node(s) being exhausted, the allowed memory\nrepresents the set of mempolicy nodes.  If it is due to a memory limit (or swap limit)\nbeing  reached, the allowed memory is that configured limit.  Finally, if it is due to\nthe entire system being out of memory, the allowed memory represents  all  allocatable\nresources.\n\nThe  value  of oomscoreadj is added to the badness score before it is used to deter‐\nmine which task to kill.  Acceptable values range from  -1000  (OOMSCOREADJMIN)  to\n+1000  (OOMSCOREADJMAX).  This allows user space to control the preference for OOM-\nkilling, ranging from always preferring a certain task or completely disabling it from\nOOM-killing.  The lowest possible value, -1000, is equivalent to disabling OOM-killing\nentirely for that task, since it will always report a badness score of 0.\n\nConsequently, it is very simple for user space to define the amount of memory to  con‐\nsider  for each task.  Setting an oomscoreadj value of +500, for example, is roughly\nequivalent to allowing the remainder of tasks sharing the same system, cpuset, mempol‐\nicy, or memory controller resources to use at least 50% more memory.  A value of -500,\non the other hand, would be roughly equivalent to discounting 50% of  the  task's  al‐\nlowed memory from being considered as scoring against the task.\n\nFor  backward compatibility with previous kernels, /proc/pid/oomadj can still be used\nto tune the badness score.  Its value is scaled linearly with oomscoreadj.\n\nWriting to /proc/pid/oomscoreadj or /proc/pid/oomadj will change the other with its\nscaled value.\n\nThe choom(1) program provides a command-line interface for adjusting the oomscoreadj\nvalue of a running process or a newly executed command.\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "/proc/pid/oomadj (since Linux 2.6.11)\nThis file can be used to adjust the score used  to  select  which  process  should  be\nkilled  in  an  out-of-memory  (OOM) situation.  The kernel uses this value for a bit-\nshift operation of the process's oomscore value: valid values are in the range -16 to\n+15, plus the special value  -17,  which  disables  OOM-killing  altogether  for  this\nprocess.   A  positive  score increases the likelihood of this process being killed by\nthe OOM-killer; a negative score decreases the likelihood.\n\nThe default value for this file is 0; a new process inherits its parent's oomadj set‐\nting.  A process must be privileged (CAPSYSRESOURCE) to update this file, although a\nprocess can always increase its own oomadj setting (since Linux 2.6.20).\n\nSince   Linux   2.6.36,   use   of   this   file   is   deprecated   in    favor    of\n/proc/pid/oomscoreadj, and finally removed in Linux 3.7.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "proc(5), procpidoomscore(5)\n\nLinux man-pages 6.7                          2023-11-24                    procpidoomscoreadj(5)",
            "subsections": []
        }
    },
    "summary": "/proc/pid/oomscoreadj - OOM-killer score adjustment",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        },
        {
            "name": "procpidoomscore",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/procpidoomscore/5/json"
        }
    ]
}