jmap报错
[root@host-10-0-197-189 service]# jmap -heap 12139
Attaching to process ID 12139, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12using thread-local object allocation.
Parallel GC with 8 thread(s)Heap Configuration:MinHeapFreeRatio = 0MaxHeapFreeRatio = 100MaxHeapSize = 4164943872 (3972.0MB)NewSize = 87031808 (83.0MB)MaxNewSize = 1388314624 (1324.0MB)OldSize = 175112192 (167.0MB)NewRatio = 2SurvivorRatio = 8MetaspaceSize = 21807104 (20.796875MB)CompressedClassSpaceSize = 1073741824 (1024.0MB)MaxMetaspaceSize = 17592186044415 MBG1HeapRegionSize = 0 (0.0MB)Heap Usage:
Exception in thread "main" java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at sun.tools.jmap.JMap.runTool(JMap.java:201)at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: java.lang.RuntimeException: unknown CollectedHeap type : class sun.jvm.hotspot.gc_interface.CollectedHeapat sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:157)at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:50)... 6 more
先看下openjdk环境版本
[root@host-10-0-197-189 service]# java -versionopenjdk version "1.8.0_191"OpenJDK Runtime Environment (build 1.8.0_191-b12)OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)[root@host-10-0-197-189 service]# whereis jmapjmap: /usr/bin/jmap /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/bin/jmap /usr/share/man/man1/jmap.1.gz
debuginfo安装
到http://debuginfo.centos.org/7/x86_64/下载对应版本的debuginfo,注意小版本号也要一致
wget http://debuginfo.centos.org/7/x86_64/java-1.8.0-openjdk-debuginfo-1.8.0.191.b12-0.el7_5.x86_64.rpm
大概86MB,下载速度较慢,要稍等一会
rpm -ivh java-1.8.0-openjdk-debuginfo-1.8.0.191.b12-0.el7_5.x86_64.rpm
安装后再测试
[root@host-10-0-197-189 ~]# jmap -heap 12139
Attaching to process ID 12139, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12using thread-local object allocation.
Parallel GC with 8 thread(s)Heap Configuration:MinHeapFreeRatio = 0MaxHeapFreeRatio = 100MaxHeapSize = 4164943872 (3972.0MB)NewSize = 87031808 (83.0MB)MaxNewSize = 1388314624 (1324.0MB)OldSize = 175112192 (167.0MB)NewRatio = 2SurvivorRatio = 8MetaspaceSize = 21807104 (20.796875MB)CompressedClassSpaceSize = 1073741824 (1024.0MB)MaxMetaspaceSize = 17592186044415 MBG1HeapRegionSize = 0 (0.0MB)Heap Usage:
PS Young Generation
Eden Space:capacity = 1225785344 (1169.0MB)used = 81512560 (77.73643493652344MB)free = 1144272784 (1091.2635650634766MB)6.649823347863425% used
From Space:capacity = 1048576 (1.0MB)used = 1035408 (0.9874420166015625MB)free = 13168 (0.0125579833984375MB)98.74420166015625% used
To Space:capacity = 31981568 (30.5MB)used = 0 (0.0MB)free = 31981568 (30.5MB)0.0% used
PS Old Generationcapacity = 142082048 (135.5MB)used = 106576600 (101.63936614990234MB)free = 35505448 (33.860633850097656MB)75.01060232465117% used33869 interned Strings occupying 3401544 bytes.
已经可以使用了