1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Thu Apr 01 20:48:50 2010 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Tue Mar 30 15:36:55 2010 -0400 1.3 @@ -198,7 +198,9 @@ 1.4 _recorded_survivor_regions(0), 1.5 _recorded_survivor_head(NULL), 1.6 _recorded_survivor_tail(NULL), 1.7 - _survivors_age_table(true) 1.8 + _survivors_age_table(true), 1.9 + 1.10 + _gc_overhead_perc(0.0) 1.11 1.12 { 1.13 // Set up the region size and associated fields. Given that the 1.14 @@ -275,6 +277,11 @@ 1.15 // calculate_young_list_target_config during initialization 1.16 _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes; 1.17 1.18 + assert(GCTimeRatio > 0, 1.19 + "we should have set it to a default value set_g1_gc_flags() " 1.20 + "if a user set it to 0"); 1.21 + _gc_overhead_perc = 100.0 * (1.0 / (1.0 + GCTimeRatio)); 1.22 + 1.23 initialize_all(); 1.24 } 1.25 1.26 @@ -2288,7 +2295,7 @@ 1.27 } 1.28 1.29 size_t G1CollectorPolicy::expansion_amount() { 1.30 - if ((int)(recent_avg_pause_time_ratio() * 100.0) > G1GCPercent) { 1.31 + if ((recent_avg_pause_time_ratio() * 100.0) > _gc_overhead_perc) { 1.32 // We will double the existing space, or take 1.33 // G1ExpandByPercentOfAvailable % of the available expansion 1.34 // space, whichever is smaller, bounded below by a minimum