jmap使用

原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/11484713.html

 

使用 -heap 查看heap空间概要

1 jmap -heap 41565 > ~/jmap.txt  

Console Output

 1 Attaching to process ID 41565, please wait...  
 2 Debugger attached successfully.  
 3 Server compiler detected.  
 4 JVM version is 25.131-b11  
 5   
 6 using parallel threads in the new generation.  
 7 using thread-local object allocation.  
 8 Concurrent Mark-Sweep GC  
 9   
10 Heap Configuration:  
11    MinHeapFreeRatio         = 40  
12    MaxHeapFreeRatio         = 70  
13    MaxHeapSize              = 1073741824 (1024.0MB)  
14    NewSize                  = 89456640 (85.3125MB)  
15    MaxNewSize               = 348913664 (332.75MB)  
16    OldSize                  = 178978816 (170.6875MB)  
17    NewRatio                 = 2  
18    SurvivorRatio            = 8  
19    MetaspaceSize            = 21807104 (20.796875MB)  
20    CompressedClassSpaceSize = 1073741824 (1024.0MB)  
21    MaxMetaspaceSize         = 17592186044415 MB  
22    G1HeapRegionSize         = 0 (0.0MB)  
23   
24 Heap Usage:  
25 New Generation (Eden + 1 Survivor Space):  
26    capacity = 314048512 (299.5MB)  
27    used     = 314048496 (299.49998474121094MB)  
28    free     = 16 (1.52587890625E-5MB)  
29    99.99999490524573% used  
30 Eden Space:  
31    capacity = 279183360 (266.25MB)  
32    used     = 279183360 (266.25MB)  
33    free     = 0 (0.0MB)  
34    100.0% used  
35 From Space:  
36    capacity = 34865152 (33.25MB)  
37    used     = 34865136 (33.24998474121094MB)  
38    free     = 16 (1.52587890625E-5MB)  
39    99.99995410890507% used  
40 To Space:  
41    capacity = 34865152 (33.25MB)  
42    used     = 0 (0.0MB)  
43    free     = 34865152 (33.25MB)  
44    0.0% used  
45 concurrent mark-sweep generation:  
46    capacity = 724828160 (691.25MB)  
47    used     = 724828160 (691.25MB)  
48    free     = 0 (0.0MB)  
49    100.0% used  
50   
51 38460 interned Strings occupying 4469136 bytes. 

使用 -histo:live 查看内存中有哪些对象

1 jmap -histo:live 41565 > ~/jmap.txt  

 

Reference

https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jmap.html

https://www.cnblogs.com/yjd_hycf_space/p/7753847.html

 

posted @ 2019-09-08 10:50  李白与酒  阅读(1714)  评论(0编辑  收藏  举报