comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 1356:56507bcd639e

6937160: G1: should observe GCTimeRatio Summary: Remove the G1GCPercent parameter, that specifies the desired GC overhead percentage in G1, and observe the GCTimeRatio parameter instead. Reviewed-by: jmasa, johnc
author tonyp
date Tue, 30 Mar 2010 15:36:55 -0400
parents a1c410de27e4
children 23b1b27ac76c
comparison
equal deleted inserted replaced
1332:4b60f23c4223 1356:56507bcd639e
196 G1YoungSurvRateNumRegionsSummary)), 196 G1YoungSurvRateNumRegionsSummary)),
197 // add here any more surv rate groups 197 // add here any more surv rate groups
198 _recorded_survivor_regions(0), 198 _recorded_survivor_regions(0),
199 _recorded_survivor_head(NULL), 199 _recorded_survivor_head(NULL),
200 _recorded_survivor_tail(NULL), 200 _recorded_survivor_tail(NULL),
201 _survivors_age_table(true) 201 _survivors_age_table(true),
202
203 _gc_overhead_perc(0.0)
202 204
203 { 205 {
204 // Set up the region size and associated fields. Given that the 206 // Set up the region size and associated fields. Given that the
205 // policy is created before the heap, we have to set this up here, 207 // policy is created before the heap, we have to set this up here,
206 // so it's done as soon as possible. 208 // so it's done as soon as possible.
272 274
273 // if G1FixedSurvivorSpaceSize is 0 which means the size is not 275 // if G1FixedSurvivorSpaceSize is 0 which means the size is not
274 // fixed, then _max_survivor_regions will be calculated at 276 // fixed, then _max_survivor_regions will be calculated at
275 // calculate_young_list_target_config during initialization 277 // calculate_young_list_target_config during initialization
276 _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes; 278 _max_survivor_regions = G1FixedSurvivorSpaceSize / HeapRegion::GrainBytes;
279
280 assert(GCTimeRatio > 0,
281 "we should have set it to a default value set_g1_gc_flags() "
282 "if a user set it to 0");
283 _gc_overhead_perc = 100.0 * (1.0 / (1.0 + GCTimeRatio));
277 284
278 initialize_all(); 285 initialize_all();
279 } 286 }
280 287
281 // Increment "i", mod "len" 288 // Increment "i", mod "len"
2286 res = MIN2(res, 1.0); 2293 res = MIN2(res, 1.0);
2287 return res; 2294 return res;
2288 } 2295 }
2289 2296
2290 size_t G1CollectorPolicy::expansion_amount() { 2297 size_t G1CollectorPolicy::expansion_amount() {
2291 if ((int)(recent_avg_pause_time_ratio() * 100.0) > G1GCPercent) { 2298 if ((recent_avg_pause_time_ratio() * 100.0) > _gc_overhead_perc) {
2292 // We will double the existing space, or take 2299 // We will double the existing space, or take
2293 // G1ExpandByPercentOfAvailable % of the available expansion 2300 // G1ExpandByPercentOfAvailable % of the available expansion
2294 // space, whichever is smaller, bounded below by a minimum 2301 // space, whichever is smaller, bounded below by a minimum
2295 // expansion (unless that's all that's left.) 2302 // expansion (unless that's all that's left.)
2296 const size_t min_expand_bytes = 1*M; 2303 const size_t min_expand_bytes = 1*M;