jcmd/jstack/jmap fail with AttachNotSupportedException
Issue
- Executing the following command results in the exceptions below:
jcmd <pid> VM.native_memory
- OpenJDK8:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
at sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:147)
at sun.tools.jcmd.JCmd.main(JCmd.java:131)
- OpenJDK11+:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/<pid>/root/tmp/.java_pid<pid>: target process <pid> doesn't respond within 10500ms or HotSpot VM not loaded
Environment
- OpenJDK
- 8
- 11
- 17
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.