Why total memory in JVM different from mx set in command line ?

Jon Masamitsu Jon.Masamitsu at Sun.COM
Sat Dec 20 19:12:55 PST 2008


In the young generation there are 3 spaces - eden plus 2 survivor
spaces.  This
organization is to enable the collection of the young generation.  See


for more details.  In calculating the total size of the heap, only 1 on
the survivor spaces is being counted.  That's because only
eden + 1 survivor space is available to the application for allocations.
That may be where the rest of the space is.  If you add -XX:+PrintHeapAtGC
you will see something like
 PSYoungGen      total 10752K, used 368K [0xf1000000, 0xf1c00000,
  eden space 9216K, 4% used [0xf1000000,0xf105c308,0xf1900000)
  from space 1536K, 0% used [0xf1a80000,0xf1a80000,0xf1c00000)
  to   space 1536K, 0% used [0xf1900000,0xf1900000,0xf1a80000)
 PSOldGen        total 24576K, used 0K [0xdb800000, 0xdd000000, 0xf1000000)
  object space 24576K, 0% used [0xdb800000,0xdb800000,0xdd000000)
 PSPermGen       total 16384K, used 1489K [0xd7800000, 0xd8800000,
  object space 16384K, 9% used [0xd7800000,0xd7974540,0xd8800000)

Which will tell you the sizes of the survivor spaces.  By the way, the
perm generation is separate from the Java heap.


David Tavoularis wrote On 12/19/08 05:48,:

>Hi all,
>According to GC logs in Java6u7 (with ParallelGC) : Young (4141888K) + Old (9601024K) + Perm (65536K) = 13808448K = 13484M
>But I have set in my application "-Xms15000m -Xmx15000m", so why is it using only 13484M and not 15000MB ?
>Here is the command line :
>/jdk1.6.0_07/bin/sparcv9/java -Djava.rmi.dgc.leaseValue=900000 -Dsun.rmi.dgc.checkInterval=2000 -Xms15000m -Xmx15000m -Dsun.rmi.dgc.ackTimeout=600000 -Dsun.rmi.transport.tcp.handshakeTimeout=480000 -Dsun.rmi.dgc.client.gcInterval=900000 -Dsun.rmi.dgc.server.gcInterval=900000 -XX:PermSize=64m -XX:+UseParallelGC -XX:+AggressiveHeap -XX:MaxPermSize=64m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/logs/gc_20081218225025.log [...]
>Is it due to "-XX:+AggressiveHeap" option ? I thought that setting explicitely "-Xms15000m -Xmx15000m" would have priority over all other settings ?
>I am asking this question, because about 80% of the time is spent in Full GC, because Old is full (and cannot decrease its used memory after Full GC) and Young has still about 4GB available memory (cf logs at the end of the mail), and the JVM is not using all the allocated memory (15000MB) I have set.
>Thanks in advance

More information about the hotspot-gc-use mailing list