I would like to profile an application that runs on Tomcat with the VisualVM tool. Unfortunately, when I tell VisualVM to profile Tomcat, Tomcat prints out a couple of messages indicating it is connecting to a profile tool and then simply exits.
Details…
I am using Windows XP, Tomcat 6, VisualVM 1.2.1, and JDK 1.6.0_11.
Note that if I right-click on the Tomcat Application and select “Heap Dump” that seems to work OK.
Java VisualVM enables you to take profiler snapshots to capture the results of a profiling session. A profiler snapshot captures the results at the moment the snapshot is taken. To take a snapshot, click the Take Snapshot of Collected Results button in the toolbar while a profiling session is in progress.
To install a VisualVM plugin:Choose Tools > Plugins from the main menu. In the Available Plugins tab, select the Install checkbox for the plugin. Click Install. Step through and complete the plugin installer.
JConsole uses only JMX, but VisualVM uses other monitoring technologies like Jvmstat, Attach API and SA in addition to JMX. It can merge data from all those monitoring technologies in one place and the user does not need to think which technology he should use in particular situation.
Connecting to a Remote Host To add a remote host, right-click the Remote node in the Applications window, choose Add Remote Host and type the host name or IP address in the Add Remote Host dialog box. (You can also specify a display name that will be used to refer to the host when listed under the Remote node.)
I have VisualVM
profiling working with my Tomcat
application now. I needed to add the following parameters to the tomcat startup:
-Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Here is a nice article on monitoring Tomcat
with VisualVM
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With