Discover Java VisualVM 1.3
A while back Java VisualVM 1.3 was released. We’ll see what’s new with this release. At this time, there is no package for Ubuntu, so we’ll install it manually :
And then we can directly launch it :
You’ll be asked for the license agreement and after that the tool is launched :
Here there is nothing new, except for the change of version. So let’s profile something. In my case, I profiled IntelliJ Idea for the test. We immediately see that there is a new tab (Sampler). If we watch the three first tabs (Overview, Monitor and Threads), we see that there is no changes.
The Sampler tab is simply a plugin (VisualVM Sampler Plugin) that has been integrated by default in VisualVM. Sampling is not like profiling. There is no instrumentation, so no setup time and almost no overhead, the application runs at full speed. This is achieved by periodically polling the monitored application for thread dumps or memory histograms. So let’s test the Sampler tab :
Like, in the Profiler tab, we can launch CPU or Memory sampling. So let’s try CPU :
You will immediately see the speed of the results: there is no time to wait, but the refreshes are slower of course, because, it’s periodic. The results are like in the Profiler tab. If we start Memory Sampling :
Once again, the results are the same as with the Profiler, but we see a new feature, the PermGen histogram :
That could be really useful to see why your application takes up a lot of PermGen space or simply to see that there is not enough PermGen space.
There is another new feature in this version. The Tracer Probes. By default, there is no installed probes, so you must install plugins to see them :
Then, just click install, accept the license agreement and let the application restart. And then, if you launch the profiling of an application, you’ll see the Tracer tab :
You see that there is a lot of probes that we can enable. So let’s enable some probes and Start the Tracer :
Like the profiler, there some time needed for instrumentation and after that you will see some graphs. There is a graph for each probe you selected. Each probe displays some specific data, for example, the Threads Probe display the number of threads and the number of Deamon threads. The JIT Compiler Probe displays the activity of the JIT compiler. Here I’ve also enabled some Swing probes because IntelliJ Idea uses Swing. There are also Probes for JavaFX. If you pass the mouse on the graphs, you will see the exact values at the time where the cursor is :
It’s think this new Tracer is just awesome. It’s really useful and really good-looking.
So we’ve now covered the main new features of this new version. I think this version adds some great new features and improvements and that will make of VisualVM an essential profiler.
For the complete information about this new version, read the release notes.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)