RFR (S): 8067341: Modify PLAB sizing algorithm to waste less

Jon Masamitsu jon.masamitsu at oracle.com
Wed Aug 26 14:36:57 UTC 2015


Looks good.

After looking at the version with G1PLABOccupancyFactor, returning
to G1LastPLABAverageOccupancy does seem more natural.   It's easier
to understand what the flag represents.

One correction on the comment.


68 // The amount of allocation performed is we can spend is independent 
of the
69 // number of threads, so is the maximum waste we can spend in total. 
So if we used Should be ? // The amount of allocation performed  is independent of the

And a suggested rewording.

   57     // Calculate the new PLAB size as the amount of space that could be wasted to
   58     // keep TargetPLABWastePct given latest memory usage and that the last buffer
59 // will be G1PLABPercent full. // The size of the PLAB caps the 
amount of space that can be wasted at the end of // the collection. 
Calculate the new PLAB size to achieve the TargetPLABWastePct
// given latest memory usage and that the last bufferwill be G1PLABPercent full.  

  Your call on the suggested rewording.  I don't need a new webrev.


On 8/26/2015 5:29 AM, Thomas Schatzl wrote:
> Hi all,
>    I tried to get some more internal comments on the question of the
> final change to improve PLAB sizes.
> On Wed, 2015-08-26 at 11:54 +0200, Thomas Schatzl wrote:
>> Hi Jon (and Eric),
> [...]
>>> When _region_end_waste is high, waste_used_for_calculation under
>>> estimates the
>>> amount used so under estimates the amount of waste (since the waste
>>> is a percentage of waste_used_for_calculation ) and so lowers the size
>>> of the next PLAB.  I can see that it scales reasonably.
>>> Why G1ExpectedAveragePLABOccupancyPercent that can be different than 50?
>>> If it is so that the user can scale the PLAB's up or down, what about
>> That is the intent.
>>> scale factor called G1PLABPercent?
>> That name seems to me a bit too unspecific, I chose
>> G1PLABOccupancyFactor for this revision. Feel free to comment on this.
> Others commented on the name and the value range; mainly that a
> percentage from 1-100 (or something similar) seems more natural or at
> least common, also the use as a divisor in the calculation.
> Using a double instead of an integer allows more flexibility in the
> choice of values.
> As for the name, the argument came up that the G1PLABPercent suggestion
> is somewhat too undescriptive, and it is better to use a longer, more
> appropriate name like G1LastPLABAverageOccupancy (note that added "Last"
> in the name). Since we do not expect it to be used a lot, except experts
> that measured that there is an issue there previously, a longer name
> does not seem to be a big issue.
> http://cr.openjdk.java.net/~tschatzl/8067341/webrev.2
> http://cr.openjdk.java.net/~tschatzl/8067341/webrev.0_to_2 (change from baseline!)
> Thanks,
>    Thomas

More information about the hotspot-gc-dev mailing list