Blocking on allocation failure - WTF?
Posted Mar 16, 2011 12:22 UTC (Wed) by epa
In reply to: Blocking on allocation failure - WTF?
Parent article: Delaying the OOM killer
Which specific case are you referring to?
I was referring to this from the article (my italics):
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.
Rather than blocking indefinitely on malloc(), it would make more sense to just return null when there is no new memory available. The application can then decide whether it wants to keep retrying indefinitely, report the error to the user, just die in a big cloud of smoke, or do something else like freeing some of its own data (e.g. the JVM could do a garbage collection pass). If malloc() just blocks forever, the app doesn't have that choice.
to post comments)