RFR (M): 8040162: Avoid reallocating PLABs between GC phases in G1

David Lindholm david.lindholm at oracle.com
Tue Aug 11 13:17:03 UTC 2015

Hi Thomas,

Great work. Looks good, reviewed.


On 2015-08-07 14:05, Thomas Schatzl wrote:
> Hi all,
>    can I have reviews for this significant improvement in memory use
> during GC by changing how G1 manages G1ParScanThreadState instances?
> So until now G1 uses separate G1ParScanThreadState instances with their
> separate PLABs for every phase of the GC. This means that the
> G1ParScanThreadState/PLAB is thrown away after every phase. This means
> that even PLABs which only have a single object in it, but are
> potentially hundreds of kB in size are filled with dummy objects and
> reloaded.
> This change instantiates a single G1ParScanThreadState for the entire
> GC. PLABs are reused as long as possible. This decreases memory use
> during GC significantly in some cases, which can significantly reduce
> the number of GCs, improves throughput, and so on.
> Care has been taken in this change to not change the values for the
> termination statistics during gc, so a few members of
> G1ParScanThreadState were relocated (making it a lot nicer too imo).
> There is also some bug where the age table and the per-region survivor
> statistics are only taken from the initial parallel collection phase
> into account.
> This will be fixed as JDK-8073146, but if wanted I can merge them.
> This change is based on the change for JDK-8073013 which is currently
> out for review.
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8040162
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8040162/webrev/
> Testing:
> lots of runs, jprt, a few aurora nightly runs
> Thanks,
>    Thomas

More information about the hotspot-gc-dev mailing list