The visualgc tool attaches to an instrumented HotSpot JVM and collects and graphically displays garbage collection, class loader, and HotSpot compiler performance data.
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
add following to /etc/profile
export JVMSTAT_HOME=/root/ jvmstat
export JAVA_HOME=/usr/local/jdk1.6
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