All entries for Thursday 24 November 2005

November 24, 2005

Remote VisualGC for JBoss

Follow-up to Garbage collection and Hibernate performance tuning from Kieran's blog

We've recently upgraded the BlogBuilder server to Java 5 and JBoss 3.2.7. I was hoping that this would cure some of my garbage collection (GC) problems, but sadly it has not. I am still getting some very long blocking 20–30 second full GCs.

My backup plan was that if just the upgrade didn't fix things, then at least I could finally use the new remote monitoring tools that come with Java 5.

VisualGC is a tool that lets you visualise what is going on in a Java processes GC. As mentioned in my previous article, you can do some analysis by looking at and analysing the log files that you can get out about GC, but they don't really show quite whats going on. VisualGC will give you something like this:

This is easy to get to work on your local machine as you just follow the instructions here

The remote stuff is slightly trickier as you'll have to run an RMI Registry on the remote machine and also the jstatd program that helps generate the statistics about the process.

You'll need to get over a few permissions issues. Create a file called jstatd.all.policy in the directory where you want to run jstatd containing the below code:

grant codebase "file:${java.home}/../lib/tools.jar" {
Make sure that the rmiregistry and jstatd are running as a user who has permission to see into the processes that you want to monitor.
rmiregistry 2020&
jstatd -p 2020&

Importantly you have to specify a port, I am using 2020 here, but you can use any port that isn't in use. The reason is that the default port is 1099 and that will usually be used by your JBoss install. If you are getting access denied errors when trying to run jstatd, there is probably something wrong with your policy file. If you get a ClassNotFoundException for the sun.jvmstat.monitor.remote.RemoteHost class, then you probably have a problem with Java versions or paths.

Once these two processes are running, you should be able to hook into an monitor your remote process like this:

visualgc pid@host:2020
Good luck!

November 2005

Mo Tu We Th Fr Sa Su
Oct |  Today  | Dec
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30            


Search this blog

Most recent comments

  • One thing that was glossed over is that if you use Spring, there is a filter you can put in your XML… by Mathew Mannion on this entry
  • You are my hero. by Mathew Mannion on this entry
  • And may all your chickens come home to roost – in a nice fluffy organic, non–supermarket farmed kind… by Julie Moreton on this entry
  • Good luck I hope that you enjoy the new job! by on this entry
  • Good luck Kieran. :) by on this entry


Not signed in
Sign in

Powered by BlogBuilder