G1 issue: falling over to Full GC
Andreas Müller
Andreas.Mueller at mgm-tp.com
Thu Nov 1 14:51:42 PDT 2012
Hi all,
I have tested G1 for our portal (using Java7u7 on Solaris 10 /SPARC).
The JVM is using a rather small heap of 1GB and the amount of garbage is moderate (in the range of 30-35 MB/s).
ParallelGC and CMS have no problem to cope with that load, but to get rid of the Full GC pauses (around 4s with ParallelGC) and to avoid any fragmentation risk (uptime is many weeks) I tried G1, too.
The good news is that G1 has improved a lot since Java6 and now looks more ready to compete with the proven collectors.
The good case JPEG (I'll send in a second mail) shows the GC pauses (in seconds) as a function of time when I ran it with the following heap and GC settings:
-Xms1024m -Xmx1024m -XX:NewSize=400m -XX:MaxNewSize=400m -XX:SurvivorRatio=18 -XX:+UseG1GC -XX:MaxGCPauseMillis=500.
As a result, after an outlier during startup the longest GC pauses are shorter than with ParallelGC and the average pause is clearly shorter than the 500ms target.
Some pauses are in the 1-2s range and I hoped to eliminate them by fine tuning the settings.
Now, here starts the bad news: fine tuning proved more difficult than expected.
I hoped to also half the longest pauses by reducing the pause time target to 250ms and therefore applied the following settings (leaving Xms, Xmx and NewSize unchanged):
-XX:SurvivorRatio=6 -XX:MaxGCPauseMillis=250 -XX:GCPauseIntervalMillis=2000 -XX:InitiatingHeapOccupancyPercent=80
Making survivor spaces larger had proven positive with ParallelGC and CMS. So I also used it here. I also wanted to make better use of the available heap and therefore set the threshold to 80 percent. The result was kind of a disaster: after a benign start pause times quickly rose to the range of 1-4(!)s and later G1 fell over to Full GCs (have a glance at the bad case JPEG).
Here are my questions:
- What did I wrong? Which setting was my biggest error and why?
- What settings would you suggest to reach my goal of having very few pauses above 1s?
- Does SurvivorRatio have the same meaning for G1 as for the traditional collectors?
- With G1, is it suitable to set the occupancy threshold to similar values as with CMS? (80 worked fine with CMS in the same test )
- Why are Full GC pauses with the failed G1 so much longer than with ParallelGC?
- I noticed in the logs that Full GC pauses take sometimes 50s of real time and only 12s of usr time. How come? I have never seen the other collectors idling on their time.
I will attach a GC log file with GCDetails to a third mail to avoid breaking the 100k limit on mails to this list.
Thank you
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20121101/2ceb98be/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: G1BadCase.jpg
Type: image/jpeg
Size: 52114 bytes
Desc: G1BadCase.jpg
Url : http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20121101/2ceb98be/G1BadCase-0001.jpg
More information about the hotspot-gc-use
mailing list