4 ms·
That's a terrible idea to disable overcommit on a generalist Linux system because: * exec * some tools or even libs map gigantic area of anon mem but only tou
by temac 3y ago
That's a terrible idea to disable overcommit on a generalist Linux system because:
* exec
* some tools or even libs map gigantic area of anon mem but only touch few bits of it.
- fweimer 3y agoYou can add enough swap space that fork+execve always works in practice (although vfork or vfork-style clone is obviously better if the goal is to execve pretty much immediately anyway). Linux allows reserving address space with PROT_NONE, populating it later with mprotect or MAP_FIXED, and many programs do it like that. However, I stopped using vm.overcommit_memory=2 because the i915 driver has something called the GEM shrinker, and that never runs in that mode. That means all memory ends up going to the driver over time, and other allocations fail eventually. Other parts of the graphics stack do not handle malloc failures gracefully, either. In my experience, that meant I got many more desktop crashes in mode 2 than in the default mode with the usual kernel OOM handler and its forced process termination.