The max heap size allocated via -Xmx
is a combination of the young generation and the tenured generation. permgen space is allocated separately, using the -XX:MaxPermSize
option to the JVM. This question is answered here:
Is permgen included in -Xmx?
One good way to determine the sizing of the different generations in the heap in a JVM - particularly on a remote server - is to use the jmap command:
http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html
Here's some sample output from a server that I administer:
$ sudo jmap -heap 28579
Attaching to process ID 28579, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 1.5.0_07-b03
using parallel threads in the new generation.
using thread-local object allocation.
Concurrent Mark-Sweep GC
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 6127878144 (5844.0MB)
NewSize = 2147483648 (2048.0MB)
MaxNewSize = 2147483648 (2048.0MB)
OldSize = 3980394496 (3796.0MB)
NewRatio = 15
SurvivorRatio = 1024
PermSize = 314572800 (300.0MB)
MaxPermSize = 314572800 (300.0MB)
Heap Usage:
New Generation (Eden + 1 Survivor Space):
capacity = 2145452032 (2046.0625MB)
used = 2130014864 (2031.3404693603516MB)
free = 15437168 (14.722030639648438MB)
99.28047014010332% used
Eden Space:
capacity = 2143420416 (2044.125MB)
used = 2130014864 (2031.3404693603516MB)
free = 13405552 (12.784530639648438MB)
99.37457197384462% used
From Space:
capacity = 2031616 (1.9375MB)
used = 0 (0.0MB)
free = 2031616 (1.9375MB)
0.0% used
To Space:
capacity = 2031616 (1.9375MB)
used = 0 (0.0MB)
free = 2031616 (1.9375MB)
0.0% used
concurrent mark-sweep generation:
capacity = 3980394496 (3796.0MB)