RFR(XS): 8240591: G1HeapSizingPolicy attempts to compute expansion_amount even when at full capacity

Ivan Walulya ivan.walulya at oracle.com
Tue Mar 10 09:26:34 UTC 2020



> 
>  some minor (imo) comments to start a discussion:
> 
> - I (weakly) suggest to remove the unnecessary assert(GCTimeRatio > 0) or put it at the beginning of the method. The initialization already guarantees that it is > 0. Probably best to move to the very top of the method.
> 
> - I think I understand why the code clears the ratio check data, presumably to avoid the "windup" of the ratio check data being stuck into the maximum, and taking some time to wind down. I think this is a good idea, but I would prefer to just unconditionally clear the data - it does not seem time consuming, and makes the code a bit smaller.

Unconditionally clearly the data is better, and yes clearing the ratio data is to avoid expansion  based on old data immediately after shrinking. The early exit does not update the windowing data.

> 
> - undecided on the log message: while it is informative, now you get a log message even if nothing changed. Maybe make it trace level? Others might chime in here with their opinions. Also given that often people set -Xms==-Xmx, this one seems to be a bit chatty at this level. I can see the point of it though.
> 

Noted, this will be changed to trace level.

> So overall, I am good with the change but asking for opinions :)
> 
> Thanks,
>  Thomas

Thanks Thomas,

//Ivan


More information about the hotspot-gc-dev mailing list