Wednesday 15 April 2015

referenced in VMStructs::localHotSpotVMStructs in the remote VM, was not present in the remote VMStructs

Hello Everyone,

Hope you all are doing well. Today here we are discussing about taking the heapdump using a jmap command. Here I have one command which successfully generate the heapdump for your running java process. While executing this command I had faced one error, which is very command and I think need to discuss with you people.

How to generate a heap dump using java process id (pid) :


The jmap is a very good utility to generate a heapdump. Using below command you can generate the heapdump for running java process

Command : jmap -dump:format=b,file=TestFile.hprof PID

Where TestFile.hprof is the dump file name you can change it accordingly.
And PID is process id of running java process for which you want to generate the heapdump

But sometime while executing this command we get the below error:

Error :

Attaching to process ID XXXX, please wait...
Exception in thread "main" 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:345)
        at sun.jvm.hotspot.HotSpotTypeDataBase.readVMStructs(HotSpotTypeDataBase.java:236)
        at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:70)
        at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:544)
        at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:476)
        at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:314)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:146)
        at sun.jvm.hotspot.tools.JMap.main(JMap.java:126)

Cause:

I was getting this error because my path to jmap wasn't the same as the path to the java process i.e. targeting two different versions. In such a case you need to set a proper path before executing the jmap command or execute command with full path of the java you are currently using.

i.e.  /opt/WebSphere85/java_1.7_64/bin/jmap -dump:format=b,file=TestFile.hprof 27693.

where /opt/WebSphere85/java_1.7_64 is my current version of java for webSphere server.

This command will generate you heapdump in your current working directory.

Hope this will help you. Kindly comment for your suggestion and quires.  

"Effort only fully releases its reward after a person refuses to quit.”

 Regards,
 Akhilesh B. Humbe

No comments:

Post a Comment

Popular Posts