What is the difference between a probe and a profiler in JvisualVM?

I found that JvisualVM has two plugins, one is a sampler and the other is a profiler.

I also found that they have a similar interface, however the results have a big difference, so what is the difference for them?

And why do they make a big difference?

+6
source share
1 answer

Generally:

The profiler works all the time, so it gives you a full call stack; at any given time.

The sampler only accepts โ€œsnapshotsโ€ at a particular point in time.

The fact is that when you "profile" everything, it greatly slows down your JVM; and it creates a huge amount of data in a few seconds. Think about it: the profiler will record each and every method call that takes place!

So, first you use the sampler when you โ€œdon't knowโ€ what is going on in your application. And then you just hope that the samples tell you something; for example "hey, in our 10,000 samples, we are in that one method most of the time, why?" But as soon as you realize that you are โ€œhuntingโ€ for yourself, you will try to run a complete profiler run to capture a whole chain of calls that leads to some method.

And then there is some "middle earth" - where you look at "everything", but exclude things. In other words: most profilers allow you to say no profile methods in the classes of a package. But, of course, excluding packages / hierarchies, it makes sense only when you already have a pretty good sense of which direction you intend to explore.

+10
source

All Articles