-> % jmap -dump:format=b,file=test.bin 3431 Dumping heap to/home/lyyljs/test.bin ... Heap dump file created -> % jhat test.bin Reading from test.bin... Dump file created Mon Mar 26 14:09:49 CST 2018 Snapshot read, resolving... Resolving 1250155 objects... Chasing references, expect 250 dots.......................................................................................................................................................................................................................................................... Eliminating duplicate references.......................................................................................................................................................................................................................................................... Snapshot resolved. Started HTTP server on port 7000 Server is ready.#可以通过ip:7000访问查看分析。
-finalizerinfo 打印等待终结(finalization)的对象信息。
1 2 3 4 5 6
-> % sudo jmap -finalizerinfo 3431 Attaching to process ID 3431, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.66-b17 Number of objects pending for finalization: 0
-> % sudo jmap -heap 3431 Attaching to process ID 3431, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.66-b17
using thread-local object allocation. Parallel GC with 2 thread(s)
-> % sudo jmap -clstats 3431 Attaching to process ID 3431, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.66-b17 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> 2778 4860705 null live <internal> 0x00000000f02caf28 1 1473 0x00000000f056f510 dead sun/reflect/DelegatingClassLoader@0x0000000100009df8 0x00000000f02cbd38 1 1471 null dead sun/reflect/DelegatingClassLoader@0x0000000100009df8 0x00000000f0174730 0 0 0x00000000f056f510 live java/util/ResourceBundle$RBClassLoader@0x00000001000c72f8 0x00000000f05410b8 138 282890 null live sun/misc/Launcher$ExtClassLoader@0x000000010000fa30 0x00000000f056f510 4783 7865232 0x00000000f05410b8 live sun/misc/Launcher$AppClassLoader@0x000000010000f688 ...
total = 167 8001 13646309 N/A alive=8, dead=159 N/A