visualgc | jps | jvmstat | Java Garbage Collection

0 Flares Facebook 0 Twitter 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×

The visualgc tool attaches to an instrumented HotSpot JVM and collects and graphically displays garbage collection, class loader, and HotSpot compiler performance data.

visualgc

JVMSTAT

Add -XX:+UsePerfData flag   – on system to be monitored.

(Over RMI)

Do following on system from where you do monitoring:-

Download jvmstat from here

cd /root

unzip jvmstat-***.zip

add following to /etc/profile

export JVMSTAT_HOME=/root/ jvmstat

export JAVA_HOME=/usr/local/jdk1.6

export PATH=$JVMSTAT_HOME/bin:$JAVA_HOME/bin:$PATH

Now on server to be monitored do following:-

vi /root/jstatd.policy and add following :-

grant codebase "file:${java.home}/../lib/tools.jar" {
    permission java.security.AllPermission;

then run following on system beeing monitored :
#jstatd -J-Djava.security.policy=/root/jstatd.policy

Now on monitoring server run following:
Check vmid using jps

#jps 192.168.1.1
17869 Bootstrap
17876 Jstatd
17877 Jps

then run visualgc

#visualgc 17869@192.168.1.1
 and enjoy the graphs ... :) 

with JDK 6 Update 23 define temp dir

jstatd -J-Djava.security.policy=jstatd.policy -J-Djava.rmi.server.logCalls=true -J-Djava.io.tmpdir=/opt/apache-tomcat-6.0.32/temp
 

Comments

  1. plan says:

    Pretty good post.