VisualVM – JvisualVM

All

Intro

While developing Java and tunning your application is quite interesting to see the features of the JVisualVM tool. This post is probably just the first about this topic.

VisualVM View

screenshot from 2019-01-07 17-55-37

> Yes, PermGen not MetaSpace hehe!

 

JVisualVM Description

It’s a visualization tool which is already in the JDK toolkit, and jdk/bin/jvisualvm. I myself created an alias on bashrc so I can use it straight away. This tool will provide you with info about the execution of Java stuff. VisualVM will detect the execution of java applications as JBoss and the java application you execute with java <option>

Auto Detect

I think the first feature of this tool I already described, which is to detect the java application execution right away and therefore

Thread counting

The thread counting is on the right down corner.  It’s also possible to do thread dumps on this tool by using the

PermGen/Heap

We can see the heap/PermGen size on the right corner as well. On the monitor tab we can do the heap dump and the GC.

Class

The number of classes is on the left down corner.

Investigating applications

We can see the evolution of the applications we study by watching how it evolves through time. The monitor is live so we can even set up a small experiment to measure the Heap Size using -Xmx option on JVM. If we put -Xmax too small, we will get straight away a java.lang.OutOfMemoryError: Direct buffer memory error, which is pretty much expected.

 

References

[1] JVisual VM Source

[2] Tutorial for JVM

Any reference of Pierre-Hugues Charbonneau is good, although the last one he did was in 2016.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s