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)
Download and install the full jdk (not a jre) on the monitoring box (I installed jdk-6u2-nb-5_5_1-win-ml.exe).
Download and extract jvmstat 3.0
Install jvmstat and follow the bundled instructions. Online instructions.
Portal Box (Solaris)
Create a policy file for jstatd to use. Step 5 Online instructions
Running VisualGC
Portal Box (Solaris)
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)
Determine the process id of the portal tomcat java process.
Run jps (it is in the same directory as jstatd).
# ./jps
13847 Bootstrap
1383 Bootstrap
1370 Bootstrap
3343 Bootstrap
13504 Jps
13503 BootstrapNote: 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.
Lets say 13503 is the portal/tomcat java process.
Monitoring Box (windows xp)
Open a cmd window.
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 |
|---|---|