简体   繁体   English

VisualVM - 无法进行堆转储

[英]VisualVM - Cannot take heap dump

When I click on the Heap Dump button in VisualVM 1.3.8, I get the following error:当我单击 VisualVM 1.3.8 中的堆转储按钮时,我收到以下错误:

Cannot take heap dump for user@localhost:9090无法为 user@localhost:9090 进行堆转储

Am I missing a setting somewhere?我在某处缺少设置吗?

Edit #1编辑#1

Environment is:环境是:

  • RHEL6 RHEL6
  • Tomcat 7.0.68雄猫 7.0.68
  • Java 1.7.0_45 Java 1.7.0_45

Options are:选项是:

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"

Edit #2编辑#2

Here is the listener for JMX.这是 JMX 的侦听器。

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="9090" rmiServerPortPlatform="9091" />

Here's what I ended up doing.这就是我最终做的事情。 We had JDK 1.8 also present on the server.我们在服务器上也有 JDK 1.8。

cd /path/to/java/jdk1.8.0_65/
./jmap -dump:format=b,file=/path/to/dump/tomcat_dump.bin PID

Open /path/to/dump/tomcat_dump.bin using VisualVM (I had to use Filezilla to bring it to my workstation).使用VisualVM打开/path/to/dump/tomcat_dump.bin (我必须使用 Filezilla 将它带到我的工作站)。

One possible reason is permission issue.一个可能的原因是权限问题。 In Windows right click on the jvisualvm executable and run as administrator solves this issue.在 Windows 中右键单击 jvisualvm 可执行文件并以管理员身份运行可解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM