Request for review (S): 7102191 G1: assert(_min_desired_young_length <= initial_region_num) failed: Initial young gen size too small

Bengt Rutisson bengt.rutisson at oracle.com
Mon Oct 24 13:54:34 PDT 2011


Hi all,

Could I have a couple of reviews for this small change?
http://cr.openjdk.java.net/~brutisso/7102191/webrev.01/

Background
When we use the NewRatio flag we set the min and max values for the 
young gen to the same value. We do this just after we have let the GC 
policy calculate min, initial and max values. However, if NewRatio is 
being used we only care about the min and max values. Thus, the 
update_young_list_size_using_newratio() method does not update any 
initial value.

This is what triggers the assert. In G1CollectorPolicy::init() first 
calculates the "default" min, initial and max values, then we detect 
that NewRatio is being used and we update min and max, but forget about 
initial.

Looking a bit closer at the calculations it turns out that the initial 
value is not needed. We only use it when we have a fixed young gen. In 
this case min == initial == max per definition. So, either min or max 
can be used instead of initial.

The fix is to delete the initial value calculation and the local variable.

CR:
7102191 G1: assert(_min_desired_young_length <= initial_region_num) 
failed: Initial young gen size too small
http://monaco.sfbay.sun.com/detail.jsf?cr=7102191

Thanks,
Bengt


More information about the hotspot-gc-dev mailing list