1

I've used cpu sampler of visualvm to record a behavior of my application for the purpose of finding a performance bottleneck. I can see some interesting results in live hotspots view, but when i take a snapshot of from the live view for later work, hotspots in that snapshot is absolutely different. This picture explains it pretty well: http://tinypic.com/view.php?pic=auhx0j&s=6

How is this inconsistency possible? Maybe I don't understand what live view and snapshot is, can someone clarify it?

calavera.info
  • 1,170
  • 2
  • 15
  • 30
  • I'm not familiar with this tool, but clearly the program is doing I/O, so CPU time is meaningless. I suggest getting familiar with the [*issues in profiling*](http://stackoverflow.com/a/1779343/23771). – Mike Dunlavey Mar 26 '13 at 12:14
  • Thanks for the tip, but relevance of those values are completely different question which I'll investigate later, but first I have to solve the mystery of those values being different in the mentioned views... – calavera.info Mar 26 '13 at 14:28

2 Answers2

1

I was also looking for the reasoning why there are inconsistencies between the sampler and snapshot hot spots. Since I couldn't find an explanation here nor anywhere else I tried to figure it out myself.

tl;dr

It is most probable a bug in the visualization of the snapshot view because it seems to not fully respect the exclusion packages like sun.* and so on which are set by default when starting the sampler.

How did I came to my conclusion?

Well, I played with different package exclusion settings turning all off, some on and so forth and always looking at the sampler and snapshot view comparing them. Although I exclude the java.*, sun.* packages they still show up in the snapshot view but not in the sampler view. What I still don't get either is when I remove all package exclusions then snapshot and sampler views are identical what everybody would expect regardless of which packages are excluded.

So far my two cents. Happy sampling!

Ewald Benes
  • 622
  • 6
  • 13
0

It looks strange. If you can provide steps how to reproduce it, I will be happy to investigate it.

Tomas Hurka
  • 6,723
  • 29
  • 38
  • Sorry, reproducing this is almost impossible, since it has been detected on preproduction environment of application bigger than mother of my worst enemy:-). – calavera.info Jul 02 '13 at 14:04