Blocking on allocation failure - WTF?
Posted Mar 10, 2011 11:56 UTC (Thu) by
alonz (subscriber, #815)
In reply to:
Blocking on allocation failure - WTF? by dgm
Parent article:
Delaying the OOM killer
Yes, you are missing something.
What you miss is that in modern Linux, malloc() practically never fails. It only allocates virtual space, which is not yet backed by physical memory.
Memory is only actually allocated when the process first touches it—which can be arbitrarily late. (Plus there are many other kinds of memory allocation: breaking of COW pages created by fork(), allocation of page structures in the kernel, skbs, …)
(
Log in to post comments)