Exception when taking a heapdump using JMAP
Asked Answered
C

2

17

I get the following exception when i take a heapdump using

jmap -F -dump:format=b,file=/tmp/heapdump/before.hprof 10737

Attaching to process ID 10737, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.tools.jmap.JMap.runTool(JMap.java:179)
    at sun.tools.jmap.JMap.main(JMap.java:110)
Caused by: java.lang.RuntimeException: Type "nmethodBucket*", referenced in VMStructs::localHotSpotVMStructs in the remote VM, was not present in the remote VMStructs::localHotSpotVMTypes table (should have been caught in the debug build of that VM). Can not continue.
    at sun.jvm.hotspot.HotSpotTypeDataBase.lookupOrFail(HotSpotTypeDataBase.java:361)
    at sun.jvm.hotspot.HotSpotTypeDataBase.readVMStructs(HotSpotTypeDataBase.java:252)
    at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:87)
    at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:568)
    at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
    at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:332)
    at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
    at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:77)

Anyone know how to resolve this ?

Cumquat answered 20/11, 2013 at 23:40 Comment(0)
I
30

I was seeing the same error because my path to jmap wasn't the same as the path to the java process (i.e. targeting two different versions).

Running jmap with the full path to my JDK resolved it.

Impresario answered 2/12, 2013 at 11:14 Comment(2)
Thanks, I ran into the same issue and it was because I was using a different jdk version to run jmap.Smack
I see this error, although only one JDK is installed and it is the same that the process uses.Jinks
B
0

If OpenJDK is used, it requires installation of debuginfo-packages.

In Centos this works with - sudo debuginfo-install java-1.8.0-openjdk - or sudo yum install java-1.8.0-openjdk-debuginfo.x86_64

See - https://bugzilla.redhat.com/show_bug.cgi?id=1010786#c15 - amazon linux - install openjdk-debuginfo?

Breslau answered 4/5, 2017 at 20:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.