{
    "mode": "man",
    "parameter": "proc_sys_vm",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/proc_sys_vm/5/json",
    "generated": "2026-10-07T20:15:25Z",
    "sections": {
        "NAME": {
            "content": "/proc/sys/vm/ - virtual memory subsystem\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "/proc/sys/vm/\nThis  directory contains files for memory management tuning, buffer, and cache manage‐\nment.\n\n/proc/sys/vm/adminreservekbytes (since Linux 3.10)\nThis file defines the amount of free memory (in KiB) on the system that should be  re‐\nserved for users with the capability CAPSYSADMIN.\n\nThe default value in this file is the minimum of [3% of free pages, 8MiB] expressed as\nKiB.  The default is intended to provide enough for the superuser to log in and kill a\nprocess,  if  necessary,  under  the  default  overcommit  'guess'  mode  (i.e.,  0 in\n/proc/sys/vm/overcommitmemory).\n\nSystems running in \"overcommit never\" mode (i.e., 2 in /proc/sys/vm/overcommitmemory)\nshould increase the value in this file to account for the full virtual memory size  of\nthe  programs used to recover (e.g., login(1) ssh(1), and top(1)) Otherwise, the supe‐\nruser may not be able to log in to recover the system.  For example, on x86-64 a suit‐\nable value is 131072 (128MiB reserved).\n\nChanging the value in this file takes effect whenever an application requests memory.\n\n/proc/sys/vm/compactmemory (since Linux 2.6.35)\nWhen 1 is written to this file, all zones are  compacted  such  that  free  memory  is\navailable  in contiguous blocks where possible.  The effect of this action can be seen\nby examining /proc/buddyinfo.\n\nPresent only if the kernel was configured with CONFIGCOMPACTION.\n\n/proc/sys/vm/dropcaches (since Linux 2.6.16)\nWriting to this file causes the kernel to drop clean caches, dentries, and inodes from\nmemory, causing that memory to become free.  This can be useful for memory  management\ntesting  and  performing  reproducible filesystem benchmarks.  Because writing to this\nfile causes the benefits of caching to be lost, it can degrade overall system  perfor‐\nmance.\n\nTo free pagecache, use:\n\necho 1 > /proc/sys/vm/dropcaches\n\nTo free dentries and inodes, use:\n\necho 2 > /proc/sys/vm/dropcaches\n\nTo free pagecache, dentries, and inodes, use:\n\necho 3 > /proc/sys/vm/dropcaches\n\nBecause  writing  to this file is a nondestructive operation and dirty objects are not\nfreeable, the user should run sync(1) first.\n\n/proc/sys/vm/sysctlhugetlbshmgroup (since Linux 2.6.7)\nThis writable file contains a group ID that is allowed to allocate memory  using  huge\npages.   If  a  process  has  a filesystem group ID or any supplementary group ID that\nmatches this group ID, then it can make  huge-page  allocations  without  holding  the\nCAPIPCLOCK capability; see memfdcreate(2), mmap(2), and shmget(2).\n\n/proc/sys/vm/legacyvalayout (since Linux 2.6.9)\nIf  nonzero,  this  disables the new 32-bit memory-mapping layout; the kernel will use\nthe legacy (2.4) layout for all processes.\n\n/proc/sys/vm/memoryfailureearlykill (since Linux 2.6.32)\nControl how to kill processes when an uncorrected memory error (typically a 2-bit  er‐\nror  in a memory module) that cannot be handled by the kernel is detected in the back‐\nground by hardware.  In some cases (like the page still having a valid copy on  disk),\nthe  kernel  will handle the failure transparently without affecting any applications.\nBut if there is no other up-to-date copy of the data, it will kill processes  to  pre‐\nvent any data corruptions from propagating.\n\nThe file has one of the following values:\n\n1      Kill  all  processes  that have the corrupted-and-not-reloadable page mapped as\nsoon as the corruption is detected.  Note that this is not supported for a  few\ntypes of pages, such as kernel internally allocated data or the swap cache, but\nworks for the majority of user pages.\n\n0      Unmap the corrupted page from all processes and kill a process only if it tries\nto access the page.\n\nThe  kill  is  performed  using  a  SIGBUS  signal  with sicode set to BUSMCEERRAO.\nProcesses can handle this if they want to; see sigaction(2) for more details.\n\nThis feature is active only on architectures/platforms  with  advanced  machine  check\nhandling and depends on the hardware capabilities.\n\nApplications  can override the memoryfailureearlykill setting individually with the\nprctl(2) PRMCEKILL operation.\n\nPresent only if the kernel was configured with CONFIGMEMORYFAILURE.\n\n/proc/sys/vm/memoryfailurerecovery (since Linux 2.6.32)\nEnable memory failure recovery (when supported by the platform).\n\n1      Attempt recovery.\n\n0      Always panic on a memory failure.\n\nPresent only if the kernel was configured with CONFIGMEMORYFAILURE.\n\n/proc/sys/vm/oomdumptasks (since Linux 2.6.25)\nEnables a system-wide task dump (excluding kernel threads) to  be  produced  when  the\nkernel  performs an OOM-killing.  The dump includes the following information for each\ntask (thread, process): thread ID, real user ID, thread group ID (process ID), virtual\nmemory size, resident set size, the CPU that the task is scheduled on,  oomadj  score\n(see  the description of /proc/pid/oomadj), and command name.  This is helpful to de‐\ntermine why the OOM-killer was invoked and to identify the rogue task that caused it.\n\nIf this contains the value zero, this information is suppressed.  On very  large  sys‐\ntems with thousands of tasks, it may not be feasible to dump the memory state informa‐\ntion  for  each one.  Such systems should not be forced to incur a performance penalty\nin OOM situations when the information may not be desired.\n\nIf this is set to nonzero, this information is shown whenever the OOM-killer  actually\nkills a memory-hogging task.\n\nThe default value is 0.\n\n/proc/sys/vm/oomkillallocatingtask (since Linux 2.6.24)\nThis enables or disables killing the OOM-triggering task in out-of-memory situations.\n\nIf  this  is set to zero, the OOM-killer will scan through the entire tasklist and se‐\nlect a task based on heuristics to kill.  This normally selects a rogue memory-hogging\ntask that frees up a large amount of memory when killed.\n\nIf this is set to nonzero, the OOM-killer simply kills the  task  that  triggered  the\nout-of-memory condition.  This avoids a possibly expensive tasklist scan.\n\nIf  /proc/sys/vm/paniconoom  is  nonzero, it takes precedence over whatever value is\nused in /proc/sys/vm/oomkillallocatingtask.\n\nThe default value is 0.\n\n/proc/sys/vm/overcommitkbytes (since Linux 3.14)\nThis writable file provides an alternative to /proc/sys/vm/overcommitratio  for  con‐\ntrolling  the CommitLimit when /proc/sys/vm/overcommitmemory has the value 2.  It al‐\nlows the amount of memory overcommitting to be specified as an absolute value (in kB),\nrather than as a percentage, as is done with overcommitratio.  This allows for finer-\ngrained control of CommitLimit on systems with extremely large memory sizes.\n\nOnly one of overcommitkbytes or overcommitratio can  have  an  effect:  if  overcom‐\nmitkbytes  has  a  nonzero value, then it is used to calculate CommitLimit, otherwise\novercommitratio is used.  Writing a value to either of these files causes  the  value\nin the other file to be set to zero.\n\n/proc/sys/vm/overcommitmemory\nThis file contains the kernel virtual memory accounting mode.  Values are:\n\n0: heuristic overcommit (this is the default)\n1: always overcommit, never check\n2: always check, never overcommit\n\nIn  mode 0, calls of mmap(2) with MAPNORESERVE are not checked, and the default check\nis very weak, leading to the risk of getting a process \"OOM-killed\".\n\nIn mode 1, the kernel pretends there is always enough memory,  until  memory  actually\nruns out.  One use case for this mode is scientific computing applications that employ\nlarge sparse arrays.  Before Linux 2.6.0, any nonzero value implies mode 1.\n\nIn mode 2 (available since Linux 2.6), the total virtual address space that can be al‐\nlocated (CommitLimit in /proc/meminfo) is calculated as\n\nCommitLimit = (totalRAM - totalhugeTLB) *\novercommitratio / 100 + totalswap\n\nwhere:\n\n•  totalRAM is the total amount of RAM on the system;\n\n•  totalhugeTLB is the amount of memory set aside for huge pages;\n\n•  overcommitratio is the value in /proc/sys/vm/overcommitratio; and\n\n•  totalswap is the amount of swap space.\n\nFor example, on a system with 16 GB of physical RAM, 16 GB of swap, no space dedicated\nto  huge pages, and an overcommitratio of 50, this formula yields a CommitLimit of 24\nGB.\n\nSince Linux 3.14, if the value in /proc/sys/vm/overcommitkbytes is nonzero, then Com‐\nmitLimit is instead calculated as:\n\nCommitLimit = overcommitkbytes + totalswap\n\nSee    also    the    description     of     /proc/sys/vm/adminreservekbytes     and\n/proc/sys/vm/userreservekbytes.\n\n/proc/sys/vm/overcommitratio (since Linux 2.6.0)\nThis writable file defines a percentage by which memory can be overcommitted.  The de‐\nfault value in the file is 50.  See the description of /proc/sys/vm/overcommitmemory.\n\n/proc/sys/vm/paniconoom (since Linux 2.6.18)\nThis enables or disables a kernel panic in an out-of-memory situation.\n\nIf  this  file  is  set  to  the value 0, the kernel's OOM-killer will kill some rogue\nprocess.  Usually, the OOM-killer is able to kill a rogue process and the system  will\nsurvive.\n\nIf this file is set to the value 1, then the kernel normally panics when out-of-memory\nhappens.  However, if a process limits allocations to certain nodes using memory poli‐\ncies  (mbind(2) MPOLBIND) or cpusets (cpuset(7)) and those nodes reach memory exhaus‐\ntion status, one process may be killed by the OOM-killer.  No  panic  occurs  in  this\ncase:  because  other  nodes' memory may be free, this means the system as a whole may\nnot have reached an out-of-memory situation yet.\n\nIf this file is set to the value 2, the kernel always  panics  when  an  out-of-memory\ncondition occurs.\n\nThe  default  value  is 0.  1 and 2 are for failover of clustering.  Select either ac‐\ncording to your policy of failover.\n\n/proc/sys/vm/swappiness\nThe value in this file controls how aggressively the kernel will  swap  memory  pages.\nHigher  values increase aggressiveness, lower values decrease aggressiveness.  The de‐\nfault value is 60.\n\n/proc/sys/vm/userreservekbytes (since Linux 3.10)\nSpecifies an amount of memory (in KiB) to reserve for user  processes.   This  is  in‐\ntended to prevent a user from starting a single memory hogging process, such that they\ncannot  recover  (kill  the  hog).   The  value  in  this file has an effect only when\n/proc/sys/vm/overcommitmemory is set to 2 (\"overcommit never\" mode).  In  this  case,\nthe  system reserves an amount of memory that is the minimum of [3% of current process\nsize, userreservekbytes].\n\nThe default value in this file is the minimum of [3% of free pages, 128MiB]  expressed\nas KiB.\n\nIf  the value in this file is set to zero, then a user will be allowed to allocate all\nfree memory with a single process (minus the amount reserved by /proc/sys/vm/adminre‐\nservekbytes).  Any subsequent attempts to execute a command  will  result  in  \"fork:\nCannot allocate memory\".\n\nChanging the value in this file takes effect whenever an application requests memory.\n\n/proc/sys/vm/unprivilegeduserfaultfd (since Linux 5.2)\nThis  (writable)  file exposes a flag that controls whether unprivileged processes are\nallowed to employ userfaultfd(2).  If this file has the  value  1,  then  unprivileged\nprocesses  may  use userfaultfd(2).  If this file has the value 0, then only processes\nthat have the CAPSYSPTRACE capability may employ userfaultfd(2).  The default  value\nin this file is 1.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "proc(5), procsys(5)\n\nLinux man-pages 6.7                          2023-09-30                               procsysvm(5)",
            "subsections": []
        }
    },
    "summary": "/proc/sys/vm/ - virtual memory subsystem",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        },
        {
            "name": "procsys",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/procsys/5/json"
        }
    ]
}