[olpc-software] graceful handling of out-of-memory conditions

Alan Cox alan at redhat.com
Mon Mar 27 13:03:56 UTC 2006


On Sun, Mar 26, 2006 at 02:03:00PM -0500, Havoc Pennington wrote:
> Making something sane happen on OOM is a lot more work than just adding 
> "if (!ptr)" checks.

That depends on the programming design. If it was designed properly you are
in deep poo. In the case of stuff like dbus its hard because you have to keep
going. Most applications can handle OOM by writing a recovery file and exiting
or in many cases where changes are committed by just going boom

> Another complexity that applies to a normal Linux system but perhaps not 
> to OLPC is that with e.g. the default Fedora swap configuration, the 
> system is unusably slow and thoroughly locked up long before malloc 

This is because if we turn on the no-overcommit mode some bits of gnome are such
a pile of leaky, bloated garbage you basically can't run stuff like evolution
at all. In no-overcommit mode the OOM situation is controlled and the malloc
fail return is very fast indeed.

Alan




More information about the olpc-software mailing list