CHROMIUM

Welcome to CHROMIUM's very own blog!

Using JvisualVM for Monitoring Memory Utilization

Being QA Engineer it should be important to monitor the memory being utilized by the application. As I am working on a JAVA project, I will share with you how this can be done in tomcat server.

 

First of all make sure JMX Remote is enabled on Server. This can be done by adding the following line in the tomcat conf file.

CATALINA_OPTS=”-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=20001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false”

20001 is the port name, this can be any port whichever you want to set.

For tomcat6 the conf file is tomcat6.conf and for tomcat7 on linux a file setenv.sh will need to be created inside bin folder. Just add the above line after creating a new file in bin.

Once the configuration is done on server side, install jdk on your local machine. Once it is installed open JVISUALVM from programfiles\java\jdk1.*.*\bin

On the left side tree, right click on Remote and click add remote host. Enter the IP address of the server. After that right click the IP address you just added and click Add JMX connection, enter the port which is configured in tomcat configuration file, in our case it is 20001. Click OK and JVISUALVM will try to connect.

Once connected you will see four graphs CPU, Memory, Classes and Threads.

CPU Usage and Memory Utilization can be monitored during testing of the application, this can actually help during performance testing of the application.

JVISUALVM

This post was viewed (36) times.

Leave a Reply

Your email address will not be published. Required fields are marked *