Activities

May 2013
M T W T F S S
« Apr   Jun »
 12345
6789101112
13141516171819
20212223242526
2728293031  

JVM Monitoring tool : JTop

Here another informative software tool for monitoring JVM statistics using JDK tools. We can get it from demo folder in JDK bundle (C:\Program Files\Java\jdk1.6.0_14\demo\management).This is the nice tool I found to monitor and identify the JVM threshold value on peak hours.

How to launch JTop

 Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\liju>jconsole -pluginpath "c:\Program Files\Java\jdk1.
6.0_14\demo\management\JTop\JTop.jar"

Now you can an applet loaded along with JTop running. Screen will look like as shown below,

One you’ve got connected, you can see the uage of HeapMemory, Threads and memory usage of classes.

VM Summary is,

Heapdump will be very useful for finding memory leakage, tuning application and debugging unexpected/unknown errors at runtime.

I found that we can not take heapdump if you use SSH tunnel for connecting JTop or VisualVM. It’s because heapdump size obviously bigger on busy servers likely more than 450Mb. So we may need to use jconsole command line utility from the same server to take the heapdump.

How do I take heapdump

[root@fc-web ~]# ps aux | grep "java" | tail -n 1 | awk  '{print $2}'
22645
[root@fc-web ~]# jmap -dump:file=heap.bin 21245
Dumping heap to /root/heap.bin ...
Heap dump file created
[root@fc-web ~]# zip heap.zip heap.bin
  adding: heap.bin (deflated 59%)
[root@fc-web ~]# du -sh heap.zip
273M    heap.zip
[root@fc-web ~]#

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>