How can I control Tomcat using jvisualvm showing visualgc?

I double checked the following:

  • I run jvisualvm in the same field where Tomcat works.
  • This is Java 6u19.
  • My Tomcat service works as the same user with whom I am registered as.
  • My Tomcat service uses the same JVM directory that I use jvisualvm with.
  • Tomcat has JMX enabled on a specific port, but I don't think this will help me.

With all this, I see my Tomcat process in the "Local" list for jvisualvm. It appears as "<Unknown application> (pid 5644)". If I double-click on it, then on each tab β€œNot supported for this JVM” is displayed. However, VisualVM appears in Local, and all the tabs work for it, obviously using the same JVM instance. There is no obvious way to add a JMX connection to an instance of "<Unknown Unknown>".

I see the Tomcat JMX instance in "Local" as "localhost: (my port number)" and it works, but the Visual GC tab displays "Not Supported for this JVM", which I suppose means Visual GC is not works through JMX.

What am I doing wrong? I tried running jstatd. It didn’t matter. When I run jstatd, visualvm sees "Local" "jstatd", but when I double-click on it, it just keeps track of this jstatd process, and not any other Java process.

NOTE. I decided to try launching Tomcat not as a service, but directly in the CMD window, but viola, now visualvm works fine. I thought I would try this when I launched "jps" and received a complaint "process information is not available" and Google for this and found someone who said they received it when they ran any Java application as a service. This helps in testing, but does not help to figure out how to control the production system.

This Tomcat runs as a Windows service under the Tanuki shell on Windows Server 2003.

+6
source share
1 answer

From your description you can see that Jvmstat will somehow break. Jvmstat is used by Visual GC, jps and VisualVM. The reason your Tomcat is an unrecognized application under the "Local" node means that VisualVM has detected (via jvmstat) that the Java application is working, but it cannot get any data about it. This may be due to the fact that you are running Tomcat as a Windows service. You can try to close all java applications and delete the hsperfdata_ {your_user_name} directory, which is located in the% TMP% directory, and restart Tomcat and VisualVM. If Tomcat is correctly recognized in the "Local" node section, Visual GC will also work. If this fails, start Tomcat and start jps with:

jps -J-Djps.debug=true -J-Djps.printStackTrace=true 

and publish the conclusion. This may show us why jvmstat cannot read information from Tomcat.

+3
source

Source: https://habr.com/ru/post/894424/


All Articles