glib dependency for the X Server

Carsten Haitzler (The Rasterman) raster at rasterman.com
Mon Apr 3 22:44:26 PDT 2006


On Tue, 04 Apr 2006 07:27:28 +0200 Xavier Bestel <xavier.bestel at free.fr>
babbled:

> Le mardi 04 avril 2006 à 09:03 +0900, Carsten Haitzler a écrit :
> > On linux with the default over committing
> > > behavior enabled the error checking code is pretty worthless too,
> > > because the kernel will just kill programs randomly on Out of memory
> > > instead of return NULL from a malloc.
> > 
> > the difference is that you should at least TRY to do the right thing.
> > overcommitting is optional and can be turned off in the kernel
> > trivially. (echo
> > 2 > /proc/sys/vm/overcommit_memory). 
> 
> The problem is that nobody uses that on their desktop, unless they are
> pretty aware of linux's internals. So you can pretty much say
> running_on_linux == program_killed_on_OOM.

sure - but there *IS* a way to do it and survive - and its a simple
configuration value at runtime. with glib you will
1. need to remove the abort (by overriding the g_try_malloc()).
2. modify a lot of glib functions to survive an alloc failure
3. be able to sanely detect this failure and recover.

disabling the overallocation is a simple runtime config matter - no source
modification needed, and so in theory good code that already handles alloc
failures should keep working.

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com
裸好多
Tokyo, Japan (東京 日本)



More information about the xorg mailing list