Reputation: 433
I am trying to profile my Web applications running on Tomcat using VisualVM. I am using Eclipse IDE by the way. There is one thing that I don't understand is, when I start my Web applications on Tomcat, then start profiling memory usage, I can only see a few classes from the package org.apache.**. I suppose there are far more classes which have been instantiated when I look at the execution log for Tomcat.
In addition, my Web applications are actually Web services developed with Apache CXF front-end. At the time of deployment, I can see from the log that a number of components for Apache CXF have already been instantiated. However, I can't find any classes related to CXF in the profiling result.
Only when I start a Web client to send a request and get back a response, I could see a number of CXF related classes in the profiling result. I suspect there should be objects already instantiated for my Web service before client requests.
Everything remains very unclear to me. Much appreciated for your answers.
Upvotes: 3
Views: 9790
Reputation: 7001
It is better to start with CPU sampling, if you don't know which part of the code is slow. Once you know better (based on the sampling results) what is going on, you can profile just part of your Tomcat server. See Profiling With VisualVM, Part 1 and Profiling With VisualVM, Part 2 to get more information about profiling and how to set profiling roots and instrumentation filter.
Upvotes: 2