Since Java 7 is going to use the new G1 garbage collection by default is Java going to be able to handle an order of magnitude larger heap without supposed \"devastating\" G
G1 makes the application a lot more agile: the latancy of the application will raise - the app can be named as "soft-real-time". This is done by replacing two kinds of GC runs (small minor ones and one big on Tenured Gen) to equal-sized small ones.
For more details look at this: http://geekroom.de/java/java-expertise-g1-fur-java-7/
Recently I have been moved from
CMS to G1GC with 4G heap & 8 core processor on servers with JDK 1.7.45.
(JDK 1.8.x G1GC is preferred over 1.7 but due to some limitations, I have to stick to 1.7.45 version)
I have configured below key parameters and kept all other parameters to default values.
-XX:G1HeapRegionSize=n, XX:MaxGCPauseMillis=m, -XX:ParallelGCThreads=n,
-XX:ConcGCThreads=n apart from -Xms and -Xmx
If you want to fine tune these parameters, have a look at this oracle article.
Key observations:
But still I am happy that Max GC pause time is less than as of CMS. I have set Max GC pause time as 1.5 seconds and this value has not been crossed yet.
Related SE question:
Java 7 (JDK 7) garbage collection and documentation on G1
G1 GC is supposed to work better. But if setting -XX:MaxGCPauseMillis too aggressively, garbage will be collecting too slowly. And that's why full GC triggered in David Leppik's example.
I have just implemented G1 Garbage Collector in our Terracotta Big Memory project. While working on different types of collectors G1 gave us the best results with less than 600ms respond time.
You can find the test results (26 in total) here
Hope it helps.