当我在 VisualVM 1.3.8 中单击堆转储按钮时,出现以下错误:
Cannot take heap dump for user@localhost:9090
我是否遗漏了某处设置?
编辑#1
环境是:
- RHEL6
- Tomcat 7.0.68
- Java 1.7.0_45
选项是:
export CATALINA_OPTS="-Dcom.sun.management.jmxremote=true\
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=true \
-Djava.rmi.server.hostname=x.x.x.x \
-Dcom.sun.management.jmxremote.password.file=/file_to_pwd \
-Dcom.sun.management.jmxremote.access.file=/file_to_access \
-Xms1256m \
-Xmx1256m \
-XX:PermSize=768m \
-XX:MaxPermSize=768m \
-XX:+CMSClassUnloadingEnabled \
-Dfile.encoding=UTF-8 \
-XX:+CMSClassUnloadingEnabled \
-XX:+UseConcMarkSweepGC \
-server"
编辑 #2
这是 JMX 的监听器。
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="9090" rmiServerPortPlatform="9091" />
最佳答案
这就是我最终做的事情。我们在服务器上还安装了 JDK 1.8。
cd /path/to/java/jdk1.8.0_65/
./jmap -dump:format=b,file=/path/to/dump/tomcat_dump.bin PID
使用 VisualVM
打开 /path/to/dump/tomcat_dump.bin
(我不得不使用 Filezilla 将它带到我的工作站)。
关于java - VisualVM - 无法进行堆转储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44269640/