vm.overcommit_memory -- do you change the default?

Latest response

Hi,
I've seen a number of out-of-memory kills on several systems so I started looking into this issue and trying to figure out what overcommit of memory actually means for a VM.

There are three possible settings:

The default value is 0. By default, the kernel performs heuristic memory overcommit handling by estimating the amount of memory available and failing requests that are too large. However, since memory is allocated using a heuristic rather than a precise algorithm, overloading memory is possible with this setting. 

When this parameter is set to 1, the kernel performs no memory overcommit handling. This increases the possibility of memory overload, but improves performance for memory-intensive tasks. 

When this parameter is set to 2, the kernel denies requests for memory equal to or larger than the sum of total available swap space and the percentage of physical RAM specified in overcommit_ratio. This reduces the risk of overcommitting memory, but is recommended only for systems with swap areas larger than their physical memory. 

The other part is when do oom kills happen - oom is triggered if any zone in /proc/zoneinfo has reached pages free min. Pages free min is a fixed

So my questions are:
* Does anyone actually change the default of 0 (overcommit but stay within limits set by kernel)? Does anyone think it would be a good idea to change this default?
* Does setting it to 2 with a reasonable number in overcommit_ratio (90 for example) ensure that there won't be any oom kills? Or could a single zone still below "min" in that case?
* Can someone explain how the kernels heuristic algorithm in RHEL7 works?

Greetings
Klaas

Responses