RFR (S): 8067341: Modify PLAB sizing algorithm to waste less
thomas.schatzl at oracle.com
Tue Aug 25 16:06:57 UTC 2015
can I have reviews for the following change that modifies the PLAB
sizing algorithm of G1 (only) to be much more stable and robust to
varying sizes of memory allocation?
The old (current for CMS) algorithm tends to create very large sized
PLABs that mean a lot of waste at the end of PLABs and particularly at
the end of regions. The other reason is that we can't figure out how the
current algorithm actually is supposed to work. :)
The end result is that PLAB sizes bounce a lot between some very low
value and maximum value (which is or has been particularly bad for g1
because of region boundaries), causing lots of wasted space. We have
seen that particularly mixed gcs waste up to 50% of memory which caused
useless GCs and degrading throughput significantly.
This changeset replaces the current algorithm with something more robust
(and rather conservative), which decreases the waste in most cases
significantly. Still it typically sizes PLABs larger than default ones
you would get with -XX:-ResizePLAB, improving performance.
The change is commented in the changeset.
In general, with fixed heap size, the change generally gives the same
overall throughput on our throughput benchmarks. Total pause times
decrease quite a bit, but since typically pause time is not an issue
there is no end-to-end difference.
The change has much more impact on applications that have a large
variety of object sizes.
This (and all other previous changes) affect automatic heap sizing
though, so it may result in some at first glance unexpected results
(like decreased heap usage). There may be some re-tuning of defaults in
jprt, perf benchmarks, tested internally in many applications for more
than a year
More information about the hotspot-gc-dev