-XX:+MaximizeHeapSize?

Jon Masamitsu Jon.Masamitsu at Sun.COM
Wed Jul 11 13:34:43 UTC 2007



Florian Weimer wrote:

>* Jon Masamitsu:
>
>  
>
>>Comments on this proposal?
>>    
>>
>
>In this mode, you really should mmap the heap PROT_NONE in the
>beginning (so that you reserve a continuous memory area, which is
>required AFAIK), and use mprotect to actually allocate backing store
>when the used portion of the heap grows.  Without this change, it's
>impossible to run more than two or three VMs on systems which do not
>support memory overcommitment (which is getting more and more common
>on Linux).
>  
>

Yes, hotspot does do a reserve of a continuous address space for the 
entire heap at
initialization with an mmap call using

    MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS

As the heap is actually expanded the space is mmap'ed with

    MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS

so it can actually be used.  See the reserve_memory() and 
commit_memory() methods
in os/linux/vm/os_linux.cpp for the details.

Thanks.




More information about the hotspot-gc-dev mailing list