2. -XX:+PrintGCDetails
• Print at Full GC.
• Summary at the end of the run.
!
2014-05-17T15:09:24.581-0900: 3.168: [Full GC (Metadata GC Threshold)
[PSYoungGen: 1371K->0K(36864K)] [ParOldGen: 10609K->8518K(64000K)] 11980K->8518K(100864K),
[Metaspace: 19037K->19037K(1067008K)], 0.0748560 secs]
[Times: user=0.22 sys=0.01, real=0.07 secs]
!
:
!
Heap
PSYoungGen total 64512K, used 51555K [0x00000007b5580000, 0x00000007ba680000,
0x00000007c0000000)
eden space 55296K, 93% used [0x00000007b5580000,0x00000007b87d8e48,0x00000007b8b80000)
from space 9216K, 0% used [0x00000007b9400000,0x00000007b9400000,0x00000007b9d00000)
to space 8704K, 0% used [0x00000007b8b80000,0x00000007b8b80000,0x00000007b9400000)
ParOldGen total 64000K, used 15253K [0x00000007a0000000, 0x00000007a3e80000,
0x00000007b5580000)
object space 64000K, 23% used [0x00000007a0000000,0x00000007a0ee5448,0x00000007a3e80000)
Metaspace used 39666K, capacity 44330K, committed 44584K, reserved 1087488K
class space used 5119K, capacity 6624K, committed 6696K, reserved 1048576K
4. jstat -gc
• Garbage-collected heap statistics.
$ jstat -gc 1489 1000
S0C S1C S0U S1U EC EU OC OU
MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
11776.0 9216.0 0.0 9193.6 52224.0 50389.1 64000.0 18622.9
44288.0 39431.8 6656.0 5092.0 19 0.144 2 0.169
0.313
11776.0 12800.0 8882.0 0.0 60928.0 767.5 64000.0 23397.3
51968.0 46211.0 7680.0 5964.2 20 0.172 2 0.169
0.340
!
MC: Metaspace capacity (KB). CCSC: Compressed Class Space capacity (KB)
MU: Metaspace utilization (KB). CCSU: Compressed Class Space used (KB)
!
Other options: -gcold, -gcoldcapacity, -gcmetacapacity, -gcutil
5. VM.native_memory
$ jcmd 3739 VM.native_memory
3739:
Native Memory Tracking:
Total: reserved=1998084KB, committed=368784KB
- Java Heap (reserved=524288KB, committed=170496KB)
(mmap: reserved=524288KB, committed=170496KB)
- Class (reserved=1105346KB, committed=63938KB)
(classes #9624)
(malloc=7618KB, #51808)
(mmap: reserved=1097728KB, committed=56320KB)
!
:
!
There is little gap with jstat - MC: Metaspace capacity . But I don t know...
!
• Please see the details in my slide Native Memory Tracking
http://www.slideshare.net/TakahiroYamada3/native-memory-tracking
7. jmap -clstats
• Print class loader statistics.
!
$ jmap -clstats 812
Attaching to process ID 812, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.5-b02
finding class loader instances ..done.
computing per loader stat ..done.
please wait.. computing liveness..............................................liveness analysis may be
inaccurate ...
class_loader classes bytes parent_loader alive? type
!
<bootstrap> 1995 3328826 null live <internal>
0x00000007a048d848 0 0 0x00000007a0046080 live org/jboss/modules/ModuleClassLoader@0x00000007c0061828
0x00000007a050d450 14 40112 0x00000007a0046080 live org/jboss/modules/ModuleClassLoader@0x00000007c0061828
0x00000007a0197618 103 184762 0x00000007a0046080 live org/jboss/modules/ModuleClassLoader@0x00000007c0061828
!
:
!
0x00000007a03da1c0 2 1793 0x00000007a0046080 live org/jboss/modules/ModuleClassLoader@0x00000007c0061828
0x00000007b5ceee30 1 1471 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009870
!
total = 233 14805 28150534 N/A alive=223, dead=10 N/A
!
It s too slow...