VisualGC

To use SUN's visualgc tool, you will need a monitoring and a monitored machine.  For this example I will be using a windows xp machine to do the monitoring, and a solaris box running tomcat 5.5.17, uPortal 2.5.2 as the machine I wish to monitor.

 Note:  The JVM on the solaris box is 1.5.0.11.

We used most of the jvm settings from this wiki page.

Setup: 

Monitoring Box (windows xp) 

  1. Download and install the full jdk (not a jre) on the monitoring box (I installed jdk-6u2-nb-5_5_1-win-ml.exe).
  2. Download and extract jvmstat 3.0
  3. Install jvmstat and follow the bundled instructions.  Online instructions.

Portal Box (Solaris)

  1. Create a policy file for jstatd to use.  Step 5 Online instructions

Running VisualGC

Portal Box (Solaris)

  1. Start jstatd located in the bin directory of your 1.5+ jre pointing to the policy file (./jstatd -J-Djava.security.policy=/path/to/jstatd.policy)
  2. Determine the process id of the portal tomcat java process.
    1. Run jps (it is in the same directory as jstatd). 
    2. # ./jps
      13847 Bootstrap
      1383 Bootstrap
      1370 Bootstrap
      3343 Bootstrap
      13504 Jps
      13503 Bootstrap
      1. Note: On solaris tomcat identifies itself as Bootstrap by default.  You can use top and lsof to determine which bootstrap is the heap you wish to monitor.
    3. Lets say 13503 is the portal/tomcat java process.

Monitoring Box (windows xp)

  1. Open a cmd window.
  2. run visualgc 13503@portal.university.edu

Here are some pictures of the tool, showing a before and after (tuning our java heap) view of our portal heap.

Before

After