jdk8:jmap

jmap作用,獲取dump文件,查詢finalize執行隊列,java堆棧以及類加載器統計。

顯示堆棧信息

[@82995c215909 /opt/logs]$ jmap -heap 12527
Attaching to process ID 12527, please wait…
Debugger attached successfully.
Server compiler detected.
JVM version is 25.101-b13

using thread-local object allocation.
Parallel GC with 33 thread(s) //GC 方式

Heap Configuration://堆內存初始化配置
MinHeapFreeRatio = 0 //對應jvm啓動參數-XX:MinHeapFreeRatio設置JVM堆最小空閒比率(default 40)
MaxHeapFreeRatio = 100//對應jvm啓動參數 -XX:MaxHeapFreeRatio設置JVM堆最大空閒比率(default 70)
MaxHeapSize = 6410993664 (6114.0MB)/對應jvm啓動參數-XX:MaxHeapSize=設置JVM堆的最大大小
NewSize = 2306867200 (2200.0MB)//對應jvm啓動參數-XX:NewSize=設置JVM堆的‘新生代’的默認大小
MaxNewSize = 2306867200 (2200.0MB)//對應jvm啓動參數-XX:MaxNewSize=設置JVM堆的‘新生代’的最大大小
OldSize = 4104126464 (3914.0MB)//對應jvm啓動參數-XX:OldSize=:設置JVM堆的‘老生代’的大小
NewRatio = 2//對應jvm啓動參數-XX:NewRatio=:‘新生代’和‘老生代’的大小比率
SurvivorRatio = 8//對應jvm啓動參數-XX:SurvivorRatio=設置年輕代中Eden區與Survivor區的大小比值
MetaspaceSize = 21807104 (20.796875MB) //對應jvm啓動參數-MetaspaceSize=:設置JVM堆的‘元空間’的初始大小; 分配給類元數據空間的初始大小(Oracle邏輯存儲上的初始高水位,the initial high-water-mark ). 此值爲估計值. MetaspaceSize設置得過大會延長垃圾回收時間. 垃圾回收過後, 引起下一次垃圾回收的類元數據空間的大小可能會變大
CompressedClassSpaceSize = 1073741824 (1024.0MB) //類指針壓縮空間大小, 默認爲1G
MaxMetaspaceSize = 17592186044415 MB //對應jvm啓動參數-MaxMetaspaceSize=:設置JVM堆的‘元空間’的最大;是分配給類元數據空間的最大值, 超過此值就會觸發Full GC. 此值僅受限於系統內存的大小, JVM會動態地改變此值
G1HeapRegionSize = 0 (0.0MB) // G1區塊的大小, 取值爲1M至32M. 其取值是要根據最小Heap大小劃分出2048個區塊.

Heap Usage:////堆內存使用情況
PS Young Generation
Eden Space:
capacity = 2218786816 (2116.0MB)
used = 1542297984 (1470.8499755859375MB)
free = 676488832 (645.1500244140625MB)
69.51086841143372% used
From Space:
capacity = 44564480 (42.5MB)
used = 5882544 (5.6100311279296875MB)
free = 38681936 (36.88996887207031MB)
13.2000732421875% used
To Space:
capacity = 43515904 (41.5MB)
used = 0 (0.0MB)
free = 43515904 (41.5MB)
0.0% used
PS Old Generation
capacity = 4104126464 (3914.0MB)
used = 55148024 (52.59325408935547MB)
free = 4048978440 (3861.4067459106445MB)
1.3437213615062715% used

27444 interned Strings occupying 3154336 bytes.

顯示堆中對象統計信息,包含類,實例數量,合計容量

-histo[:live]        to print histogram of java object heap; if the "live"
[@82995c215909 /opt/logs]$ jmap -histo 12527

 num     #instances         #bytes  class name
 編號     個數                字節     類名
----------------------------------------------
   1:       3472120      448670168  [C
   2:       2133951      400454032  [B
   3:         42628      298218744  [I
   4:       2037477       89988696  [Ljava.lang.Object;
   5:       3031288       72750912  java.lang.String
   6:       1308033       41857056  java.util.HashMap$Node
   7:       1673694       34107192  [Ljava.lang.Class;
   8:        363209       22618424  [Ljava.util.HashMap$Node;
   9:        830984       19943616  java.util.IdentityHashMap$EntryIterator$Entry
  10:        181240       14499200  java.lang.reflect.Constructor
  11:        422551       13521632  com.alibaba.fastjson.parser.ParseContext
  12:        249533       11977584  java.util.HashMap
  13:          4039        9598224  [J
  14:        178068        8547264  java.util.IdentityHashMap$EntryIterator
  15:        134148        7512288  java.util.LinkedHashMap
  16:        303126        7275024  java.lang.Long
  17:        163622        5235904  java.util.concurrent.locks.AbstractQueuedSynchronizer$Node
  18:         12526        4549984  [Lcom.alibaba.fastjson.parser.ParseContext;
  19:        141422        4525504  java.util.LinkedHashMap$LinkedKeyIterator
  20:        107257        4275968  [Ljava.lang.String;
  21:        120468        3854976  java.util.concurrent.ConcurrentHashMap$Node
  22:         95655        3826200  java.util.LinkedHashMap$Entry
  23:         43136        3795968  java.lang.reflect.Method
  24:         78713        3778224  java.nio.HeapByteBuffer
  25:        132668        3184032  java.util.ArrayList

類加載器統計

[@82995c215909 /opt/logs]$ jmap -clstats 12527
Attaching to process ID 12527, please wait…
Debugger attached successfully.
Server compiler detected.
JVM version is 25.101-b13
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
類加載器 類的個數 字節數 父類加載器 存活? 類型
2837 4995376 null live
0x0000000641e00be0 4 3471 null dead sun/misc/LauncherExtClassLoader@0x00000007c000fa300x0000000642f15ff037905010x0000000641e00b80deadcom/alibaba/fastjson/util/ASMClassLoader@0x00000007c03c7dc00x00000006430e3108114740x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de2cd818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c3f00114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de3ed018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c3b18114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000736956c80114710x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e3f18114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de37c818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643484f50197020x0000000641e00b80deadorg/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader@0x00000007c049f0e00x00000006420c4d1024839nulldeadjavax/management/remote/rmi/NoCallStackClassLoader@0x00000007c00a8fd80x00000006440d6e10114850x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e3810114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e511018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de30c018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c49281880nulldeadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e3428114740x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de2ff818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c4220114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e2d2018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de28f018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de41f018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de45f018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c3e38114710x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006440d6738114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e4238114710x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de3ae818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c3730114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e3b30114850x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de33e011495nulldeadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006440d6d48114720x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e3748114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de3f9818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c4540114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e304018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de389018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006420c4158114710x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e2c5818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de318818800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000642f26ca818472050x0000000641e00b80deadcom/alibaba/fastjson/util/ASMClassLoader@0x00000007c03c7dc00x00000006420c3a50114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x00000006430e3e50114730x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de2a8018800x0000000641e00b80deadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000643de43801880nulldeadsun/reflect/DelegatingClassLoader@0x00000007c0009df80x0000000641e00b808657147610580x0000000641e00be0deadsun/misc/Launcher AppClassLoader@0x00000007c000f688
0x00000006420c3668 1 1476 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3a68 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de29b8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de42b8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de46b8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c4860 1 880 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3360 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3bb0 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c4478 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e2f78 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de34a8 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006421a1a60 0 0 0x0000000641e00b80 dead java/util/ResourceBundle$RBClassLoader@0x00000007c00bff00
0x00000006420c3d70 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006440d6670 1 1483 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e4170 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de2da0 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c3988 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000736954810 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3d88 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3958 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006440d6c80 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3680 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3250 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006440d6398 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3298 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e4b98 1 1505 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de2b48 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de4448 1 1474 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c4090 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3d40 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000738f16450 1 880 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c3ca8 1 1476 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006440d65a8 1 880 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000736959230 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e40a8 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3c78 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e39a0 1 1485 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3570 1 1471 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e35b8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de2e68 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c43b0 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e2eb0 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de4060 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c3fc8 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3318 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c38c0 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3cc0 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de2c10 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006440d6ed8 1 1499 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e38d8 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e51d8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3e08 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e31d0 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3700 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c42e8 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c4de8 4 4029 null dead javax/management/remote/rmi/NoCallStackClassLoader@0x00000007c00a8fd8
0x00000006430e2de8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3638 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c3be0 1 1471 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006440d64e0 1 1473 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e26e0 1 880 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3fe0 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de2f30 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c33f8 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006420c37f8 1 1474 null dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e3bf8 1 1473 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de2828 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de4128 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de4528 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x00000006430e34f0 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8
0x0000000643de3a20 1 880 0x0000000641e00b80 dead sun/reflect/DelegatingClassLoader@0x00000007c0009df8

total = 118 11669 20043639 N/A alive=1, dead=117 N/A

生成java堆的快照

[@82995c215909 /opt/logs]$ jmap -dump:format=b,file=/tmp/text1 12527
Dumping heap to /tmp/text1 …
Heap dump file created

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章