>> When a process malloc's memory, you return a null pointer, and the
> program should quit (if it's well written) or soon core dump, if it's
> not. The kernel should reserve the last meg or two for itself, so it could
> keep running until enough processes are given the chop.
>Ah this is what Linux does, unfortuantely Linux also does something call
memory overcommital (or something similiarly named), if I do
malloc(3000000) or whatever, the kernel doesn't give me that much memory
until I start to use it later on by dirtying the pages.... so there is no
where for the app to realise oh crap malloc failed as malloc didn't fail,
the kernel just didn't have anything left to fill out the memory it
promised the application earlier on ....
I have no links, but there is some reason on the net why this is a good
idea ...
Dave.
--
David Airlie, Software Engineer
Drua Technologies Ltd, Innovation Centre, National Tech Park, Limerick.
t: +353-61-503075 / f: +353-61-338065 / David.Airlie at drua.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!