我正在尝试使用 jcmd 监视 tomcat 的本机内存,但出现以下异常:命令:jcmd 14533<pid of tomcat> VM.native_memory summary
我已经安装了 2 jdk's
jdk-11
AND jdk-8
。
Tomcat正在运行jdk-8
并使用jcmdjdk-11
然后我得到以下异常:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/31752/root/tmp/.java_pid31752: target process 31752 doesn't respond within 10500ms or HotSpot VM not loaded
at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(VirtualMachineImpl.java:100)
at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:58)
at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
at jdk.jcmd/sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:114)
at jdk.jcmd/sun.tools.jcmd.JCmd.main(JCmd.java:98)
我-XX:+StartAttachListener
与java进程连接,但它没有工作。