VisualVM is a kind of data gathering software for application which are running under the Java Virtual Machines (JVM). This retrieve information related to the Java application, like heap size, heap dumps, RAM utilisation, CPU utilisation, thread count and so on. There is an special interface that they use for getting information from application ends and gathered information is analysed and displayed on the VisualVM dashboard. Remote application also can be monitored via VisualVM. Specially user can get snapshot of heat dumps also.
Follow the steps to install VisualVM on Ubuntu server.
# sudo apt-get install visualvm
# which viaualvm
# java -version
You can check the java is up & running up using the commands given above. And for testing purpose, I’m here using a Java testing application in the same host. Let’s open the visualVM and configure it to get the information of running applications.
if you need any help related to visualVM you can us,
# visualvm - -help
After open the VisualVM, then you will see the terms and condition that should be accepted. Please accept it and go ahead.
After you agreed to the license agreement you will be displayed the VisualVM home page. In this home page you can see the options that you are having on VisualVm. In the Left side all the options are available. The image given below shows the sample home page of VisualVM.
To test an application, here I’m going to run a test application which contains a digital clock. Download the application using the following link.
- com.sun.management.jmxremote.port :state which port is assigned to the Application.
- com.sun.management.jmxremote.ssl : State the SSL certificate settings.
- com.sun.management.jmxremote.authenticate : State the remote Authentication settings.
After you double-click on the Application, dashboard will be loaded and retrieve analytics and data according to the application weight. In following image you can see, both application are in same dashboard.
- Overview : Contains PID, Host name, arguments, heap dumb, so on, this provides basic idea of the running application.
- Monitor : Processor consuming, memori consuming likewise utilisation detail.
- Threads : List of entire threads, state of threads, running time, and so on.
- Sampler : Sampling information, like CPU, memory.