Re:Linux memory overcommit (compared to airlines selling tic...
by ajross on Friday May 13, 2011 @06:42PM
(#2546493)
Saving results to disk requires disk buffers, which can require the kernel to allocate, which won't work on an OOM system. This is how you get deadlocks: process trying to "handle" OOM ends up trying to allocate, and the system freezes. Which is why the OOM killer exists.
I should have said "underutilized" above. But the point is very real: applications map stuff all over the place. It's quite rare that they actually fault in those pages.
The stack thing is the obvious example: measure the stack size of your application (easy trick is to subtract the address of a local variable "deep" in the tree from the address of one of the arguments to main, or pthread_create, or wherever the top is). Now check the size of the mapping that contains the stack. And tell me if you want to actually reserve all that memory.
Also, this means that I can screw up other processes for no good reason, even though only my proc should get killed for going over quota.
"Mappings are overcommited because mappings are routinely undercommitted"
Could you please explain this again? I'm not quite sure I parsed that out correctly. Thanks!