Search code examples
javavisualvm

How to display the call tree in VisualVM?


When profiling the CPU time of an application with VisualVM, one can see a "Call Tree" tab after taking a snapshot. But in my case, the call tree only shows some RMI TCP classes and methods, but no single class of my application.

How can I display the correct call tree?

enter image description here


Solution

  • Possibilities

    1. The Profiler settings are excluding your classes. Change the excludes in the Profiler settings.
    2. Your application was idle while the profiler was running. Attach the profiler then cause the program to execute the code you want to profile.
    3. You might be profiling the wrong JVM. RMI makes it pretty easy to call into another JVM. Maybe you need to be profiling the other side of that RMI connection.

    There is a "Settings" checkbox on the Profiler tab. If you check the Settings box another panel will show up that lets you configure what classes the profiler collects data about.

    Here is a screenshot. screeshot of jvisualvm with Profiler "Settings" box checked.