pf » Visualize Garbage Collection
Visualize Garbage Collection

Sun has released (for free) a very cool program called Visual GC 2.0 in their jvmstat toolkit (via: Moazam Raja). The tool will show you graphically how memory is organized into generation in your JVM. This is very handy for tuning garbage collection parameters because you can see how your application uses the JVM's different generations.
For instance if we wanted to visualize garbage collection on a ColdFusion MX application server (note JVM 1.4.2 is required MX 6.1 includes uses version), the first thing we need to know is the process ID of the JVM. This can be found with the utility that comes with jvmstat called jvmps
C:\bin\jvmstat\bat>jvmps 3096 3416 jvmps.jar
From my testing you need to be running as the same user that created the JVM. So if your running ColdFusion MX as a service on Windows it is probable that the JVM is running under the SYSTEM account. To get around this run C:\CFusionMX\bin\cfstop.bat and then C:\CFusionMX\bin\cfstart.bat this will start CFMX as the user that your logged in as. If your on unix you can just su or sudo using the user CFMX is running as.
Next you just launch the visualgc program:
C:\bin\jvmstat\bat>visualgc 3096
And here's what the output might look like:

Related Entries
- Robi Sen on Hung Servers, java.lang.OutOfMemory errors and Tuning CF JVM - November 19, 2004
- ColdFusion Garbage - June 3, 2004
- Tuning Garbage Collection - June 3, 2004
- Bea JRockit 5 JVM Released - February 22, 2005
- Java 1.5 for FreeBSD Patchset Released - February 18, 2005
- ColdFusion 8 FCKeditor Vulnerability
- Ajax Same Origin Policy No More with Firefox 3.5
- Firefox 3.5 Introduces Origin Header, Security Features
- Tips for Secure File Uploads with ColdFusion
- 7 Years And Blog Entry Number 700
- CFCatch Java Exceptions
- Cheat Sheet for SQL Server
- CFML on Google App Engine for Java
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in










