Domanda

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

È stato utile?

Soluzione

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]

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top