diff options
author | Chuck Ebbert <76306.1226@compuserve.com> | 2005-09-09 16:10:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 17:03:43 -0400 |
commit | af97c7220a0376beed827e72e3bb27731af7109d (patch) | |
tree | dae9462270cf9345184b23c95fedbe0fb414514b /Documentation | |
parent | ddb99f3d35b178f0715aab2f9d9ab25f61814347 (diff) |
[PATCH] docs: fix misinformation about overcommit_memory
Someone complained about the docs for vm_overcommit_memory being wrong.
This patch copies the text from the vm documentation into procfs.
Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/proc.txt | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 5024ba7a592c..d4773565ea2f 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -1241,16 +1241,38 @@ swap-intensive. | |||
1241 | overcommit_memory | 1241 | overcommit_memory |
1242 | ----------------- | 1242 | ----------------- |
1243 | 1243 | ||
1244 | This file contains one value. The following algorithm is used to decide if | 1244 | Controls overcommit of system memory, possibly allowing processes |
1245 | there's enough memory: if the value of overcommit_memory is positive, then | 1245 | to allocate (but not use) more memory than is actually available. |
1246 | there's always enough memory. This is a useful feature, since programs often | 1246 | |
1247 | malloc() huge amounts of memory 'just in case', while they only use a small | 1247 | |
1248 | part of it. Leaving this value at 0 will lead to the failure of such a huge | 1248 | 0 - Heuristic overcommit handling. Obvious overcommits of |
1249 | malloc(), when in fact the system has enough memory for the program to run. | 1249 | address space are refused. Used for a typical system. It |
1250 | 1250 | ensures a seriously wild allocation fails while allowing | |
1251 | On the other hand, enabling this feature can cause you to run out of memory | 1251 | overcommit to reduce swap usage. root is allowed to |
1252 | and thrash the system to death, so large and/or important servers will want to | 1252 | allocate slighly more memory in this mode. This is the |
1253 | set this value to 0. | 1253 | default. |
1254 | |||
1255 | 1 - Always overcommit. Appropriate for some scientific | ||
1256 | applications. | ||
1257 | |||
1258 | 2 - Don't overcommit. The total address space commit | ||
1259 | for the system is not permitted to exceed swap plus a | ||
1260 | configurable percentage (default is 50) of physical RAM. | ||
1261 | Depending on the percentage you use, in most situations | ||
1262 | this means a process will not be killed while attempting | ||
1263 | to use already-allocated memory but will receive errors | ||
1264 | on memory allocation as appropriate. | ||
1265 | |||
1266 | overcommit_ratio | ||
1267 | ---------------- | ||
1268 | |||
1269 | Percentage of physical memory size to include in overcommit calculations | ||
1270 | (see above.) | ||
1271 | |||
1272 | Memory allocation limit = swapspace + physmem * (overcommit_ratio / 100) | ||
1273 | |||
1274 | swapspace = total size of all swap areas | ||
1275 | physmem = size of physical memory in system | ||
1254 | 1276 | ||
1255 | nr_hugepages and hugetlb_shm_group | 1277 | nr_hugepages and hugetlb_shm_group |
1256 | ---------------------------------- | 1278 | ---------------------------------- |