-
-
Save jarek-przygodzki/a2d94452217aaadeb90aa3dec9cf9bb4 to your computer and use it in GitHub Desktop.
$ jmap -heap 66 | |
Attaching to process ID 66, please wait... | |
Debugger attached successfully. | |
Server compiler detected. | |
JVM version is 25.111-b14 | |
using parallel threads in the new generation. | |
using thread-local object allocation. | |
Concurrent Mark-Sweep GC | |
Heap Configuration: | |
MinHeapFreeRatio = 40 | |
MaxHeapFreeRatio = 70 | |
MaxHeapSize = 268435456 (256.0MB) | |
NewSize = 87228416 (83.1875MB) | |
MaxNewSize = 87228416 (83.1875MB) | |
OldSize = 181207040 (172.8125MB) | |
NewRatio = 2 | |
SurvivorRatio = 8 | |
MetaspaceSize = 21807104 (20.796875MB) | |
CompressedClassSpaceSize = 1073741824 (1024.0MB) | |
MaxMetaspaceSize = 17592186044415 MB | |
G1HeapRegionSize = 0 (0.0MB) | |
Heap Usage: | |
Exception in thread "main" java.lang.reflect.InvocationTargetException | |
at 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.CollectedHeap | |
at sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:144) | |
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:49) | |
... 6 more |
yum --enablerepo="*-debug*" install java-1.8.0-openjdk-debuginfo
I installed java-1.8.0-openjdk-debuginfo package, but still get this exception.
me too, I have installed debuginfo package
root@53d1a6e4cf7f:/opt# rpm -qa |grep debuginfo
java-1.8.0-openjdk-debuginfo-1.8.0.111-1.b15.el7_2.x86_64
root@53d1a6e4cf7f:/opt# jmap -heap 8
Attaching to process ID 8, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.111-b14
using thread-local object allocation.
Parallel GC with 4 thread(s)
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 1073741824 (1024.0MB)
NewSize = 536870912 (512.0MB)
MaxNewSize = 536870912 (512.0MB)
OldSize = 536870912 (512.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at 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.CollectedHeap
at sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:144)
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:49)
... 6 more
you are not alone, latest centos, java-1.8.0-openjdk.x86_64 1:1.8.0.201.b09-2.el7_6, java-1.8.0-openjdk-debuginfo-1.8.0.201.b09-2.el7_6.x86_64 =
sudo jmap -heap 13443
Heap Usage:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at 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.CollectedHeap
at 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)
I had the same issue and ended up giving Amazon's Coretto OpenJDK distro a try: https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html and it worked (installed via rpm, switched using alternatives, on CentOS 7 x86_64)
yum --enablerepo="*-debug*" install java-1.8.0-openjdk-debuginfo
works for me
me too, I have installed debuginfo package
root@53d1a6e4cf7f:/opt# rpm -qa |grep debuginfo
java-1.8.0-openjdk-debuginfo-1.8.0.111-1.b15.el7_2.x86_64root@53d1a6e4cf7f:/opt# jmap -heap 8
Attaching to process ID 8, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.111-b14using thread-local object allocation.
Parallel GC with 4 thread(s)Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 1073741824 (1024.0MB)
NewSize = 536870912 (512.0MB)
MaxNewSize = 536870912 (512.0MB)
OldSize = 536870912 (512.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)Heap Usage:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at 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.CollectedHeap
at sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:144)
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:49)
... 6 more
make sure you have the identical version number for openjdk and the openjdk-debuginfo, otherwise the error will persist, I have been there :)
On Ubuntu Server 18.04, apt install openjdk-8-dbg
fixed it for me
To find openjdk-debuginfo