Skip to main content

jdk7 using G1 garbage collector

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2011-03-30


I have been trialling JDK7 and find the Garbage First garbage collector XX:+UseG1GC to provide good performance at least when I time application usage.

In some situations I like to configure JVM to use a throughput collector XX:+UseParallelGC. Other times I like to use a low pause collector eg Xincgc XX:+UseParNewlGC. Depends what works best for the end users and application performance as well as stability.

To satisfy myself how well the JVM is running I usually enable JVM logging -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -verbose:gc -Xloggc:jvmGC.log or use Jconsole and Jvisualvm. I find the log syntax generated by JVM logging when using UseG1GC to be different in syntax than when using UseParallelGC (or other Xincgc UseParallelOldGC etc) and am indeed wondering how to compare log output for performance statistics? Jconsole seem to show heap memory combined and I do not see Eden and Survivor Space usage? Is there a guide on how to monitor JVM when enabled UseG1GC?

I also note UseG1GC seems to use less memory than the other collectors, surprising even Permanent Generation seems lower nut just heap?
Thanks, Carl.