Question

I'm trying to get the memory layout of a remote Tomcat visualized with Visual GC in Java VisualVM. On the Linux server which hosts the Tomcat jstatd is running (including tools.policy and the proper [-J]-Djava.rmi.server.hostname=[SERVER_IP], which is to be found in the jvm options of the Tomcat as well).
The connection from VisualVM to the server/jstatd works properly:

Connection tree of jvisualVM

But all i can see in the Visual GC tab of the Jstatd connection are the memory details of the Jstatd JVM itself, not the data of the Tomcat.
Edit: And in the Visual GC tab of the Tomcat connection (prod apl01 jmx) I'm being told: "Not supported for this JVM" Testing this with a system we run inhouse I get proper data here.

The remote Tomcat runs with it's own user "tomcat". Must jstatd be started by this user as well? Or is there another issue I might be missing?

Any working alternative like another visual tool that provides a visualization similar to the one below would be absolutely acceptable. We're using Yourkit as well, but I couldn't find anything in there that resembles Visual GC easy to understand style.
Visual GC memory layout visualization

Was it helpful?

Solution

Having done some more research and tests on our locale development environment i realized that we haven't had the right permissions on the production environment. So i asked the admin to add jstatd to the sudoers list and voilà it works as expected:

sudo /usr/java/latest/bin/jstatd -J-Djava.security.policy=/home/empulse/tools.policy -J-Djava.rmi.server.hostname=[SERVER_IP]

OTHER TIPS

On remote server create policy,

vim /tmp/tools.policy

Add Permission,

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

And start jstatsd,

jstatd -J-Djava.security.policy=/tmp/tools.policy -J-Djava.rmi.server.hostname=<public_ip>

and you ready are with Visual GC inside VisualVM on local machine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top