Get heap dumps from remote applications in Java using jvisualvm

I run jvisualvm (Windows XP, Sun Java 1.6.0.13, 32-bit client VM) to monitor remote applications (Linux, Sun Java 1.6.0.07, 64 bit server VM) Before starting the actual remote application, I use all access policies to start on the remote machine jstatd:

grant codebase "file:${java.home}/../lib/tools.jar" {
   permission java.security.AllPermission;
};

Then I use the command line to start the actual application

java -Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.port=3333 
compileTest.Main

From the client, I can see the remote application and monitor it I can also do a thread dump, etc Unfortunately, the heap dump button is gray

How to obtain heap dumps from remotely monitored applications using jvisualvm?

I tried jconsole Using jconsole, you can use COM sun. management. The hotspot diagnostic dumpheap operation performs a remote heap dump I want to transfer the dump to the client and analyze it using the tools provided by jvisualvm What shall I do?

Solution

There's a way to do it!

> rmiregistry -J-Xbootclasspath / p:$JAVA_ HOME / lib / sa-jdi. Jar (this uses port 1099) > start 'jsadebugd' on the machine running the application: jsadebugd & (the PID of the JVM) > the remote machine uses the following jmap - dump: file =: 1099 > jhat

The web application will start on port 7000

All of the above tools are part of JDK 1.6

I wish you all the best!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>