Search This Blog

Monday, 20 June 2011

JVM monitoring

this is an example of how to monitoring the execution of a JVM running JBoss 4.2.3 GA under Solaris OS:

1. set the following Java options in run.conf (if you are on Windows, set them in run.bat)
JAVA_OPTS="....... -XX:+HeapDumpOnOutOfMemoryError -Djboss.platform.mbeanserver -Djava.rmi.server.hostname= ............"
2. use jvisualvm.exe in your JDK to attach to the remote JBoss: Remote -> Add Remote Host -> add JMX connection -> :9999
3. run the following script on the server, to get memory utilization percentages:

pid=`/bin/jps -l | grep Main | awk {'print $1'
/bin/jstat -gcutil $pid 2000

No comments:

Post a Comment