I have a Linux machine with no swap, which has vm.overcommit_memory=2
and vm.overcommit_ratio=100
set. However these settings seem to have no effect. Some newly-started processes which attempt to consume a lot of memory are still being OOM-killed instead of being denied memory allocation. Is it because processes started before sysctl -w vm.overcommit_memory=2 vm.overcommit_ratio=100
(e.g. before /etc/sysctl.conf
is applied during boot) may still be able to access their overcommitted memory and thereby trigger the OOM-killer? Is it possible to (1) disable memory overcommit using kernel parameters, or (2) at runtime force the kernel to allocate all overcommitted memory for all processes?
EDIT: After browsing relevant Documentation/
and some of the Linux source code (git c6fa8e6de3) (1) seems unlikely.