【发布时间】:2020-05-28 20:14:42
【问题描述】:
我正在尝试使用 jcmd 监控 tomcat 的本机内存,但出现以下异常:
命令:jcmd 14533<pid of tomcat> VM.native_memory summary
我已经安装了 2 个 jdk's jdk-11 和 jdk-8。
Tomcat 由 jdk-8 运行,jcmd 使用 jdk-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)
我用 java 进程附加了-XX:+StartAttachListener,但它不起作用。
【问题讨论】:
-
希望这可能会有所帮助:stackoverflow.com/questions/25438983/…