Explanation of JDK heap space
Explanation of Sun JDK heap space
Check also :
http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html
http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html
https://oracle-base.com/articles/misc/monitoring-java-garbage-collection-using-jstat
The hotspot (read sun) heap is split into several parts, so when you specify -Xmx you are really setting a maximum for the entire heap, and not part of it.
Eden is a small part of the overall heap, its kept small to ensure that the application does not stop for long periods of time during collection. All new objects (that fit) go into eden to start with, if they are not garbage they will get promoted to either the survivor spaces or tenure.
Survivor (The To/From space) is a place for the GC to try to get objects that might be garbage, but could not be worked out quickly during eden collection, there are two survivor spaces which act as buffers, as one is filled by the GC the other is drained into tenure, if you were to watch the graphs you will see these two spaces flipping over in usage.
Tenure is where long lived objects reside, this heap is typically quite large and is collected by a different algorithm to that of eden.
Perm is somewhat separate to the rest of the heap, it is where constant strings (any string that has been "interned") and class bytecode live. It is very rare that you need to tune it, typically it only needs to be increased for huge applications, or for applications that (badly) auto-generate code.
Without pause times I cannot really say if you have your JVM settings quite right, but from your heap sizes you appear to be using roughly 1.2 Gb of your allocation. Unless your application is seeing any nasty pauses I would think that you are done with GC tuning (people often go to town on a huge number of flags without really understanding what they do, leave the flags be until you have proven to yourself that they are needed)
You are aiming for low latency on web applications so the usage of ConcurrentMarkSweep as the tenure collector is a sane choice.
[root@lonlx11346 ~]# /usr/java/jdk1.6.0_21/bin/jmap -heap 25941 ---> PID of java process ]
Attaching to process ID 25941, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 17.0-b16
using thread-local object allocation.
Parallel GC with 4 thread(s)
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 536870912 (512.0MB)
NewSize = 1048576 (1.0MB)
MaxNewSize = 4294901760 (4095.9375MB)
OldSize = 4194304 (4.0MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 16777216 (16.0MB)
MaxPermSize = 134217728 (128.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 133234688 (127.0625MB)
used = 25529248 (24.346588134765625MB)
free = 107705440 (102.71591186523438MB)
19.161112157218398% used
From Space:
capacity = 14155776 (13.5MB)
used = 0 (0.0MB)
free = 14155776 (13.5MB)
0.0% used
To Space:
capacity = 13369344 (12.75MB)
used = 0 (0.0MB)
free = 13369344 (12.75MB)
0.0% used
PS Old Generation
capacity = 321585152 (306.6875MB)
used = 203850360 (194.40685272216797MB)
free = 117734792 (112.28064727783203MB)
63.389232597405496% used
PS Perm Generation
capacity = 113639424 (108.375MB)
used = 80413464 (76.6882553100586MB)
free = 33225960 (31.686744689941406MB)
70.76194261597102% used
[root@lonlx11346 ~]# ps -ef|grep 25941
Example:
JSTAT command:
/usr/java/jdk1.6.0_21/bin/jstat -gcutil 5276 250 7
S0 S1 E O P YGC YGCT FGC FGCT GCT
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
0.00 38.97 23.30 24.82 99.87 19228 391.327 481 1788.949 2180.276
-gcutil Option
Summary of Garbage Collection Statistics Column Description
S0 Survivor space 0 utilization as a percentage of the space's current capacity.
S1 Survivor space 1 utilization as a percentage of the space's current capacity.
E Eden space utilization as a percentage of the space's current capacity.
O Old space utilization as a percentage of the space's current capacity.
P Permanent space utilization as a percentage of the space's current capacity.
YGC Number of young generation GC events.
YGCT Young generation garbage collection time.
FGC Number of full GC events.
FGCT Full garbage collection time.
GCT Total garbage collection time.
/usr/java/jdk1.6.0_21/bin/jstat -gcpermcapacity 5276 250 7
PGCMN PGCMX PGC PC YGC FGC FGCT GCT
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
16384.0 131072.0 79104.0 79104.0 19228 481 1788.949 2180.276
-gcpermcapacity Option
Permanent Generation Statistics Column Description
PGCMN Minimum permanent generation capacity (KB).
PGCMX Maximum permanent generation capacity (KB).
PGC Current permanent generation capacity (KB).
PC Current permanent space capacity (KB).
YGC Number of young generation GC events.
FGC Number of full GC events.
FGCT Full garbage collection time.
GCT Total garbage collection time.
/usr/java/jdk1.6.0_21/bin/jstat -gccause 5276 250 7
S0 S1 E O P YGC YGCT FGC FGCT GCT LGCC GCC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
0.00 38.97 13.86 24.82 99.87 19228 391.327 481 1788.949 2180.276 unknown GCCause No GC
-gccause Option
This option displays the same summary of garbage collection statistics as the -gcutil option, but includes the causes of the last garbage collection event
and (if applicable) the current garbage collection event. In addition to the columns listed for -gcutil, this option adds the following columns:
Garbage Collection Statistics, Including GC Events Column Description
LGCC Cause of last Garbage Collection.
GCC Cause of current Garbage Collection.