On a normal x86/32 Linux system the limit for a single malloc is 2 GB. That is because the top 1 GB of the 4 GB virtual address space is taken by the kernel and some idiot placed the shared libraries at 1 GB, fragmenting space.
Note that if you have overcommit memory off, then your available swapspace+RAM is the limit, on some systems (Fedora Core 2 apparently among them) swapspace is the limit.
On many systems, e.g. some BSD systems there is a some-hundred megabyte limit single some mallocs don't fall back to mmap() when brk() fails, and they only brk below the shared libraries also placed at 1 GB. You can get more memory by using anonymous mmap() on your own account.
On a Fedora Core 2 x86/32 system you have a sane placement of shared libraries and you have the 4 GB VM patch applied, so you could map continuously map from 0x0800000 + executable size to the end of 4 GB which would be 3968 MB. However, it seems FC2's kernel does not add RAM + swapspace together, swapspace seems to be the limit. For some additional reason, 2672 MB seems to be the limit in practice on my FC2 machine (no ulimit, 51673032 K swapspace). What the hell?!? My life is ruined, fedora is cutting me off my own swapspace.
EDIT/UPDATE: hm, FC2 places some other anonymous junk at 0x55000000, but not always. That's why you can only map from above that to 4 GB which is 2672 MB.
Last edited by cracauer; 08-25-2004 at 03:53 PM.
|