G1GC success examples (compared to CMS) ?
Charlie Hunt
chunt at salesforce.com
Wed Nov 14 07:21:14 PST 2012
Hi Nobuhiko,
I had done some comparisons with CMS (and with Parallel[Old]GC).
What I had done was induced the undesirable behavior of heap fragmentation and object allocation spikes into application running with CMS via -javaagent.
* Fyi, -javaagent essentially allows you to run another Java program in parallel with your Java app. (Thanks Vladimir Ivanov, cc'd, for suggesting the idea to use -javaagent.)
I also did the same experiment against G1.
What those experiments illustrated was G1 in the presence of either heap fragmentation or wide swings in object allocation rates offered much more predictable behavior than CMS, in particular, avoiding (the painful) full GCs.
To date, the focus with G1 was been more so on larger Java heaps, than on smaller Java heaps with lower than say 100ms - 150ms pause times. The folks at Oracle may be able to offer additional comments.
If I were to summarize where I see G1 wrt CMS today, I would say that if you are experiencing full GCs with CMS, due to fragmentation, or "losing the race" [1], or you have a desire to be able to run your Java application with a smaller Java heap, then G1 will likely help. If you are able to run with CMS today, and experience no full GCs and the amount of memory your Java heap is using, then you're probably (at this point in time) will have better results with CMS. I would additionally add that since G1 is expected to one day be the replacement for CMS, (which won't happen until it's pretty well shown that G1 can do better than CMS on those apps running CMS today), it's advisable that you if you're using CMS today, you probably should periodically take a look at G1 and offer feedback to this mailing list of your observations. And, most importantly, if you can, offer both the CMS and G1 logs (please include -XX:+PrintGC[Date|Time]Stamps and -XX:+PrintGCDetails) along with the JDK/JRE version (i.e. java -version) and the set of command line options you are using for both G1 and CMS.
If you happen to have those GC logs today, I'd be happy to take a look.
hths,
charlie ...
[1] "losing the race" -- a situation where objects are getting promoted to old generation faster than the rate at which than the CMS collector can collect them from old generation and leads to a compaction of old generation via a full GC ... other words, the old generation concurrent collector lost the race with the promotion rate and the JVM needed to do a full GC as a corrective action.
On Nov 13, 2012, at 2:20 PM, Sekiya Nobuhiko wrote:
> Hi,
>
> Has anybody found successful test case in G1GC compared to CMS?
> I search this mailing list but couldn't find anybody commenting such one.
>
> If you know any good cases, I would like to know that test case.
>
> If you know that there are really no good examples at current, I would appreciate that information too.
>
> I'm testing G1 with 7u7, but really could not get good results.
>
> Best Regards,
> Nobuhiko
>
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
More information about the hotspot-gc-use
mailing list