2 Minutes To Code (β Version)

JVisualVM - 2 minute tutorial

How to connect to remote jvm in jvisualvm

To connect to jvm running on a remore server, you need to run 'jstatd' utility (bundled with jdk downloads), on the target remote server.

To run jstatd, you need to provide it some security permissions. This is how it is done : Create a file with name 'jstatd.all.policy' an dput the following contnts in it
grant codebase "file:${java.home}/../lib/tools.jar" {

   permission java.security.AllPermission;

Now, run the command jstatd on the remote server using the command

jstatd -J-Djava.security.policy=jstatd.all.policy

By default, the remote jvm will expose minimal data/functional to a remote jvisualvm instance. To make the remote jvm expose its threads data, mbeans, profiling functionality, you need to start the remote jvm with these additional system properties :

Now, start jvisualvm, and on teh menu bar click on File > Add Remote Host , add the ip and click connect. JVisualVM will now fetch all the jvms running on that server.