The amazing adventures of Doug Hughes

The G1 garbage collector has been made available in the 1.6_14 release of Sun’s JDK. There was some controversy initially when this was released due to some wording in the license, but the wording has since been updated. Sun was trying to indicate that no support would be provided for the G1 garbage collector, yet it initially came across that you could not even use it unless you had a paid support contract (you can read more about the licensing changes here). This new garbage collector is meant to replace the current ‘mark and sweep’ collector that most people are using. The G1 collector is targeted at server environments which multi-core CPU’s with large amounts of memory, and aims to minimize delays and ‘stop the world’ collections, replacing with concurrent garbage collecting while normal processing is still going on. With the current collector, all processing has to be halted for the GC to iterate through the heap and mark any items for collection, with the next garbagecollection run actually ‘sweeping’ the items out of heap. The G1 organizes memory into smaller pieces called ‘cards’, and as items survive each garbage collection and become older, they are compacted to the older side of the heap. This helps minimize pauses that occur with the mark and sweep collector, and should show good performance improvements with long running applications.To enable the G1 garbage collector, add the following to your jvm.config file after java.args=

 -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC 

While I have not done extensive testing, running with the 1.6_14 release and the G1 collector seems to be quite zippy, and has been working great with CF 8.01, Model Glue:Unity, Transfer, and Coldspring, so I would say things look pretty good for the Coldfusion community and the latest from Sun. I plan on releasing some benchmarks that show the long-term performance of the G1 collector, look for that in posts to come.

Tag Cloud

%d bloggers like this: