When Linux Runs Out of Memory
Subject:   Re: Try testing your facts before posting an article
Date:   2007-07-20 22:59:22
From:   mulyadi_santosa
Response to: Try testing your facts before posting an article

Hi Bill...

Thanks for the critism. As soon as you mentioned this, I re-check the fact on my FC5 installation (2.6.15.x kernel). I re-ran loop-calloc.c, but first I change my uid (using su) to non root user (let's say abc). I did:
ulimit -v 51200
to limit the available virtual memory to uid abc up to 50 MB. loop-calloc gives me these:
Currently allocating 47 MB
Currently allocating 48 MB

So malloc stops when it allocates 48 MB of VM. The rest is, of course, consumed by code and data section of the code (and the loader, shared lib, etc). pay attention that this limit is per session: applied immediately after you type it in shell session. Once you exit from this session, it's no longer true.

perhaps you get different result?