0

I am not sure if Java VisualVM does not do this, or if I am not using the correct terminology, or seeing the menu option.

Say one has done a CPU profile of an app with 3 methods.

time 0001: method A called
time 0002:   method B called
time 0004:   method B exits
time 0005:   method B called
time 0007:   method B exits
time 0008: method A exits
time 0009: method C called
time 0010:   method B called
time 0012:   method B exits
time 0013: method C exits

The only view I can get to shows me:

method B duration 6
method A duration 2
method C duration 2

But one should be able to flip the perspective (and does this have a standard name?) to see:

method A duration 7
method B duration 6
method C duration 4

How can I get this second view of the CPU timing out of Java VisualVM? Am I not seeing the option, or is it not there?

I see this: Total method time in Java VisualVM

But I do not see anything in the Call Stack that is from any of my objects. Would I have to be comparing two snapshots? This is incredibly non-obvious....

Community
  • 1
  • 1
Ray Kiddy
  • 3,521
  • 3
  • 25
  • 32
  • Ok, so now I am seeing the button enabled. Hm. My code takes 20 seconds to run. All of my code, in all its invocations, runs in less than 200 milliseconds. Something is not quite right here.... – Ray Kiddy Oct 18 '12 at 19:29
  • I suggest you try a commercial profiler, you can usually get a free eval license for a couple of weeks. When it comes to profilers, you get what you pay for. – Peter Lawrey Oct 18 '12 at 21:18
  • If you want to know what's taking time, there's a simple way. [*Try this.*](http://stackoverflow.com/a/317160/23771) – Mike Dunlavey Oct 19 '12 at 02:52

0 Answers0