Tony Printezis provided some insight into G1 in JavaOne last year. Now, we can see G1 in action with the latest JDK 6 builds. HotSpot JVM features this new collection mechanism in the recent Java SE update 14 early access builds (since b02). It is not enabled by default as this is still an experimental beta feature. But it is quite easy to enable this option for your application.
To enable it, use the JVM option:
-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
The available collectors in JDK 6 are:
1. Serial (-XX:+UseSerialGC)
2. Parallel (-XX:+UseParallelGC)
3. Concurrent (-XX:+UseConcMarkSweepGC)
Sun’s research paper explains the algorithm behind this collector. The G1 collector is meant to be an alternate for the concurrent collector for the HotSpot 14.
Java SE 6 Update 14 FCS is planned for Q2 2009. The latest available build is b03.
I did play with this new feature from b02 and my initial tests showed that it does not perform better yet than the concurrent collector. I am planning to run some more tests with b03 and will keep updated on my findings.