VisualVM - Cannot take heap dump
Asked Answered
M

2

7

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" />
Montoya answered 30/5, 2017 at 18:42 Comment(8)
Please provide some details of the environment.Aeolotropic
Added details for the environmentMontoya
jvisualvm -J-Dnetbeans.logger.console=true should show some details of the error on the console.Aeolotropic
I'm using VisualVM binary on Windows. Does this still apply?Montoya
I am sure it applies :)Aeolotropic
Added it to etc/visualvm.conf... looking for the "console"...Montoya
Are you monitoring local or remote application?Careful
I am monitoring a remote server containing many applicationsMontoya
M
12

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

Montoya answered 20/7, 2017 at 13:10 Comment(0)
F
1

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

Feria answered 20/5, 2022 at 6:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.