简体   繁体   中英

VisualVM - Cannot take heap dump

When I click on the Heap Dump button in VisualVM 1.3.8, I get the following error:

Cannot take heap dump for user@localhost:9090

Am I missing a setting somewhere?

Edit #1

Environment is:

  • RHEL6
  • Tomcat 7.0.68
  • 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

Here is the listener for 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.

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).

One possible reason is permission issue. In Windows right click on the jvisualvm executable and run as administrator solves this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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