Blocking on allocation failure - WTF?
Posted Mar 16, 2011 15:22 UTC (Wed) by giraffedata
In reply to: Blocking on allocation failure - WTF?
Parent article: Delaying the OOM killer
Should an out-of-memory situation come about, the processes in the affected group will simply block when attempting to allocate memory until the situation improves somehow.
Right. The process here does not block in malloc(). It blocks typically on a store instruction, but also on any of various system calls, such as open(). A malloc() at this time would succeed.
The process is attempting to allocate memory, as it is the process that is doing the system call or triggering the page fault in which kernel code attempts to allocate physical memory. malloc(), in contrast, doesn't, from the kernel's point of view, allocate memory — just addresses for it.
The article probably should have made a clearer distinction between memory as seen by user space code and memory as seen by the kernel.
to post comments)