Java Heap and -Xms/-Xmx
Keith.Holdaway at sas.com
Tue Jul 1 11:01:42 PDT 2008
Sorry, no. My question is:
If I set -Xms1g -Xmx2g and I have 4gb RAM, then will the VM always look to commit the 2GB Java heap to RAM? Or will it simply commit 2GB to virtual memory? Opening with -Xms of 1GB to RAM, but perhaps at runtime as the heap grows, the remaining 1GB java heap could be paged out. I understand the Java heap should not be paged out by the OS on account of performance overtones, but at start up when the heap is not stuck, by setting -Xms < -Xmx, what happens vis-à-vis the addressable memory that is the contiguous java heap? Spread out ENTIRELY on RAM, if available, or if available, could it still be RAM and non-RAM?
Hope my question is not too confusing.
Keith R Holdaway
Java Development Technologies
SAS The Power to Know
From: Jon.Masamitsu at Sun.COM [mailto:Jon.Masamitsu at Sun.COM]
Sent: Tuesday, July 01, 2008 1:56 PM
To: Keith Holdaway
Cc: hotspot-gc-dev at openjdk.java.net
Subject: Re: Java Heap and -Xms/-Xmx
Is this your question with numbers.
If flag -Xmx1g -Xms500m are set on the command line
and there is 2g of physical memory, will the VM
increase the maximum heap size to 2g?
No, the VM would not set the maximum heap size to
2g. In general, the user gets what is requested
on the command line.
Was that the question?
Keith Holdaway wrote:
> If -Xms is set to a smaller value than -Xmx, and -Xmx is set to a value less than the total RAM, will the VM commit the -Xmx setting to physical addressable space ONLY?
> Keith R Holdaway
> Java Development Technologies
> SAS The Power to Know
> Carpe Diem
More information about the hotspot-gc-dev