I am trying to use the visualvm program that comes with the JDK to profile a webapp running in Tomcat. I have no problems connecting and everything looks nice and works properly in the GUI, except that my classes do not show. When profiling, using the CPU screen, I only see catalina and a few other classes' methods listed. How can I have visualvm show the method invocations of the webapp that Tomcat is running (rather than just Tomcat itself)?
If it helps: This is with Tomcat 6.0.26 and JDK 1.6.0.22
First use the Sampler plugin. It will give you overall picture what is going on. If you need to more information, profile your Tomcat server and set root methods. For more details how to set correct profiler settings, please see Profiling With VisualVM, Part 1 and Profiling With VisualVM, Part 2