diff options
Diffstat (limited to 'Documentation/filesystems/proc.txt')
-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 | ---------------------------------- |