heap limits: mmap(2) vs. break(2) on i386

Jason Evans jasone at FreeBSD.org
Fri Nov 27 23:19:20 UTC 2009


Maxim Sobolev wrote:
> I am trying to figure out why java fails to start with 1024MB of heap on 
> i386 with 4GB of RAM and 4GB of swap. Both MAXDSIZ and DFLDSIZ are set 
> to 2GB.

Some memory (1GiB?) is reserved for kernel address space, and you 
reserved 2GiB for DSS.  That leaves less than 1GiB available after 
shared libraries and whatnot are mapped.  If there is more than 1GiB 
available, mmap can still fail due to the memory being non-contiguous.

Jason


More information about the freebsd-hackers mailing list