RFR(S): JDK-8028093 - Initial young size is smaller than minimum young size

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Mon Nov 11 20:21:42 UTC 2013

Hi Jon,

On 11/11/13 19:14, Jon Masamitsu wrote:
> On 11/9/13 3:17 PM, Jesper Wilhelmsson wrote:
>> Hi,
>> Can I have a couple of reviews of this small bugfix.
>> Bug JDK-8028093: https://bugs.openjdk.java.net/browse/JDK-8028093
>> The problem is that TwoGenerationCollectorPolicy::adjust_gen0_sizes() is
>> called with the wrong argument in one place. The last argument should always
>> be the value of _min_gen1_size, but in one call it is the _initial_gen1_size.
>> Since these variables are class local I see no reason to take _min_gen1_size
>> as an argument at all. Apparently it is error prone. The proposed fix is
>> therefore to remove the argument and use _min_gen1_size directly in
>> adjust_gen0_sizes().
> I've been looking at recent versions of the
> TwoGenerationCollectorPolicy::initialize_size_info()
> and it seems like the change that causes the assertion failure was from
>      _min_gen1_size = OldSize;
> to
>      _min_gen1_size = MIN2(OldSize, _min_heap_byte_size - _min_gen0_size);
> Is that right?

In some sense, yes.

> Before that change _min_gen_size and _initial_gen1_size were the
> same value in the call path where adjust_gen0_sizes() is called.

Yes, they were both set OldSize and OldSize was passed to adjust_gen0_sizes() 
as the min_gen1_size.

After the cleanup _min_gen1_size and _initial_gen1_size does not have the same 
value anymore in this call path which is why we need to decide which variable 
is the correct one to use. To preserve the behavior from before the collector 
policy cleanup I think _min_gen1_size is the variable to use.

As Bengt has pointed out, this code is not extremely intuitive and should be 
cleaned up further. I have a list of things to improve in the collector policy 
code and this code on that list. I'll be filing an RFE at some point.


> Jon
>> Webrev: http://cr.openjdk.java.net/~jwilhelm/8028093/webrev/
>> Thanks!
>> /Jesper
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jesper_wilhelmsson.vcf
Type: text/x-vcard
Size: 236 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20131111/5ec6796a/jesper_wilhelmsson.vcf>

More information about the hotspot-gc-dev mailing list