Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display the call tree in VisualVM?

Tags:

java

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

like image 560
John Threepwood Avatar asked Sep 01 '13 18:09

John Threepwood


People also ask

How do I monitor VisualVM?

Under the Local node in the Applications window, right-click the application node and choose Open to open the application tab. Click the Profiler tab in the application tab. Click Memory or CPU in the Profiler tab. When you choose a profiling task, VisualVM displays the profiling data in the Profiler tab.

What is profiler in VisualVM?

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.

How do I use VisualVM in STS?

Launch Eclipse and click 'Help' -> 'Install New Software…'. Click 'Add..', fill in a name and then click 'Local'. Find your VisualVM launcher folder and select it. If you now return to the Install Software dialog you should see the launcher feature available to install.

Is VisualVM part of JDK?

Various optional tools, including Java VisualVM, are provided with the Java Development Kit (JDK) for retrieving different types of data about running JVM software instances. For example, most of the previously standalone tools JConsole, jstat, jinfo, jstack, and jmap are part of Java VisualVM.


1 Answers

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.

like image 162
Ryan Avatar answered Nov 24 '22 10:11

Ryan