G1 guidelines/suggestions
charlie hunt
charlie.hunt at oracle.com
Fri Feb 20 15:59:06 UTC 2015
Hi Joy,
The obvious case where G1 will do better is where CMS is experiencing promotion failures due to old generation heap fragmentation.
It might be easier to suggest where G1 currently may not do better than CMS, and also realize that this is a moving target. I would also suggest that if you can wait a few more weeks until JDK 8u40 comes out, you will likely have a better G1 experience than with previous JDK 8 (or JDK 7) releases due to the amount of G1 improvements being made.
To date, the areas where G1 may not do as well as CMS are:
1.) Frequent large / humongous object allocations. If you have an application is doing frequent large object allocations, 1/2 a G1 region size or greater, a tuned CMS will probably do better out of the box than G1 with a min / max heap size and pause time target. There are ways to tune G1 that will help with frequent large object allocations, and there is a specific enhancement in JDK 8u40 that should help too.
2.) In general, if you are expecting to consistently see GC pause times at or less than 50 ms. G1 in its current state may have difficulty in beating a tuned CMS that consistently does less than 50 ms pauses. Until recently there has not been much focus on pause times less than 50 ms for G1. Most of its focus to date has been on larger Java heaps and a little less pause time constraint, say in that 100ms to 500 ms range, Realize that 100 ms to 500 ms time range is very general statement!
I would also suggest that you start with JDK 8u40 (when it is generally available) on one of your applications, and if you can share any of your observations, there are folks on this mailing who would be very interested.
A presentation that might help you with migrating from CMS to G1, especially with JVM command line options:
http://www.slideshare.net/MonicaBeckwith/garbage-first-garbage-collector-g1-gc-migration-to-expectations-and-advanced-tuning <http://www.slideshare.net/MonicaBeckwith/garbage-first-garbage-collector-g1-gc-migration-to-expectations-and-advanced-tuning>
* There is a section in this slide deck specifically on CMS to G1 migration, (starts on slide 47).
One thing I think you will find is that tuning G1 is much, much easier than tuning CMS. :-)
hths,
charlie
> On Feb 19, 2015, at 4:14 PM, Joy Xiong <joyxiong at yahoo.com> wrote:
>
> Hi,
>
> We have hundreds of services all running with CMS, and I am very interested in moving the services from CMS to G1. For that efforts to be convincing, I'd like to start services which has the most potential to beat CMS in terms of performance. I understand JVM performance is very application-specific, but still I want to check if anybody has guidelines/suggestions on which type of applications can benefit from G1 the best?
>
> Appreciate any comments you may have.
> -Joy
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20150220/1e3ce689/attachment.html>
More information about the hotspot-gc-use
mailing list