Issues attaching jcmd and jmap to IntelliJ IDEA

Hi, I'm trying to profile my IntelliJ IDEA plugin but I'm having problems attaching jcmd and jmap to IntelliJ:



I am using OS X 10.9.2 and am using Java 8, IntelliJ IDEA 13.1.1


IntelliJ instance is running as pid 35148

jcmd 35148 help
35148:
java.io.IOException: Command failed in target VM
 at sun.tools.attach.BsdVirtualMachine.execute(BsdVirtualMachine.java:208)
 at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualMachine.java:217)
 at sun.tools.attach.HotSpotVirtualMachine.executeJCmd(HotSpotVirtualMachine.java:199)
 at sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:149)
 at sun.tools.jcmd.JCmd.main(JCmd.java:128)
Same with jmap:

jmap 35148
Attaching to process ID 35148, please wait...
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:483)
 at sun.tools.jmap.JMap.runTool(JMap.java:201)
 at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: java.lang.InternalError: void* type hasn't been seen when parsing int*
 at sun.jvm.hotspot.HotSpotTypeDataBase.recursiveCreateBasicPointerType(HotSpotTypeDataBase.java:687)
 at sun.jvm.hotspot.HotSpotTypeDataBase.lookupType(HotSpotTypeDataBase.java:131)
 at sun.jvm.hotspot.HotSpotTypeDataBase.lookupOrCreateClass(HotSpotTypeDataBase.java:597)
 at sun.jvm.hotspot.HotSpotTypeDataBase.createType(HotSpotTypeDataBase.java:717)
 at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:188)
 at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:86)
 at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:403)
 at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)
 at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
 at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
 at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
 at sun.jvm.hotspot.tools.PMap.main(PMap.java:72)
 ... 6 more

I've tried connecting to IntelliJ IDEA Ultimate and Community Edition.

jvisualvm and jconsole work ok as does jstack but I wanted to know if I could get these other tools to work.

1 comment

In my case this happened with a junit-test process because I used jmap from Java 8, but the process was started from IntelliJ with Java 6.Using the same version of Java on both ends made it work.

 

See https://bugs.openjdk.java.net/browse/JDK-8073307 for some related discussion.

0

Please sign in to leave a comment.