1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Mon May 04 02:57:39 2009 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Thu Apr 30 15:07:53 2009 -0700 1.3 @@ -136,7 +136,7 @@ 1.4 _scanned_cards_seq(new TruncatedSeq(TruncatedSeqLength)), 1.5 _rs_lengths_seq(new TruncatedSeq(TruncatedSeqLength)), 1.6 1.7 - _pause_time_target_ms((double) G1MaxPauseTimeMS), 1.8 + _pause_time_target_ms((double) MaxGCPauseMillis), 1.9 1.10 // </NEW PREDICTION> 1.11 1.12 @@ -220,7 +220,7 @@ 1.13 _par_last_termination_times_ms = new double[_parallel_gc_threads]; 1.14 1.15 // start conservatively 1.16 - _expensive_region_limit_ms = 0.5 * (double) G1MaxPauseTimeMS; 1.17 + _expensive_region_limit_ms = 0.5 * (double) MaxGCPauseMillis; 1.18 1.19 // <NEW PREDICTION> 1.20 1.21 @@ -249,12 +249,12 @@ 1.22 1.23 // </NEW PREDICTION> 1.24 1.25 - double time_slice = (double) G1TimeSliceMS / 1000.0; 1.26 - double max_gc_time = (double) G1MaxPauseTimeMS / 1000.0; 1.27 + double time_slice = (double) GCPauseIntervalMillis / 1000.0; 1.28 + double max_gc_time = (double) MaxGCPauseMillis / 1000.0; 1.29 guarantee(max_gc_time < time_slice, 1.30 "Max GC time should not be greater than the time slice"); 1.31 _mmu_tracker = new G1MMUTrackerQueue(time_slice, max_gc_time); 1.32 - _sigma = (double) G1ConfidencePerc / 100.0; 1.33 + _sigma = (double) G1ConfidencePercent / 100.0; 1.34 1.35 // start conservatively (around 50ms is about right) 1.36 _concurrent_mark_init_times_ms->add(0.05); 1.37 @@ -262,7 +262,7 @@ 1.38 _concurrent_mark_cleanup_times_ms->add(0.20); 1.39 _tenuring_threshold = MaxTenuringThreshold; 1.40 1.41 - if (G1UseSurvivorSpace) { 1.42 + if (G1UseSurvivorSpaces) { 1.43 // if G1FixedSurvivorSpaceSize is 0 which means the size is not 1.44 // fixed, then _max_survivor_regions will be calculated at 1.45 // calculate_young_list_target_config during initialization 1.46 @@ -451,7 +451,7 @@ 1.47 guarantee( adaptive_young_list_length(), "pre-condition" ); 1.48 1.49 double start_time_sec = os::elapsedTime(); 1.50 - size_t min_reserve_perc = MAX2((size_t)2, (size_t)G1MinReservePerc); 1.51 + size_t min_reserve_perc = MAX2((size_t)2, (size_t)G1MinReservePercent); 1.52 min_reserve_perc = MIN2((size_t) 50, min_reserve_perc); 1.53 size_t reserve_regions = 1.54 (size_t) ((double) min_reserve_perc * (double) _g1->n_regions() / 100.0); 1.55 @@ -1109,7 +1109,7 @@ 1.56 _short_lived_surv_rate_group->record_scan_only_prefix(short_lived_so_length); 1.57 tag_scan_only(short_lived_so_length); 1.58 1.59 - if (G1UseSurvivorSpace) { 1.60 + if (G1UseSurvivorSpaces) { 1.61 _survivors_age_table.clear(); 1.62 } 1.63 1.64 @@ -1826,11 +1826,11 @@ 1.65 _rs_lengths_seq->add((double) _max_rs_lengths); 1.66 1.67 double expensive_region_limit_ms = 1.68 - (double) G1MaxPauseTimeMS - predict_constant_other_time_ms(); 1.69 + (double) MaxGCPauseMillis - predict_constant_other_time_ms(); 1.70 if (expensive_region_limit_ms < 0.0) { 1.71 // this means that the other time was predicted to be longer than 1.72 // than the max pause time 1.73 - expensive_region_limit_ms = (double) G1MaxPauseTimeMS; 1.74 + expensive_region_limit_ms = (double) MaxGCPauseMillis; 1.75 } 1.76 _expensive_region_limit_ms = expensive_region_limit_ms; 1.77 1.78 @@ -2093,24 +2093,24 @@ 1.79 } 1.80 1.81 double G1CollectorPolicy::recent_avg_time_for_pauses_ms() { 1.82 - if (_recent_pause_times_ms->num() == 0) return (double) G1MaxPauseTimeMS; 1.83 + if (_recent_pause_times_ms->num() == 0) return (double) MaxGCPauseMillis; 1.84 else return _recent_pause_times_ms->avg(); 1.85 } 1.86 1.87 double G1CollectorPolicy::recent_avg_time_for_CH_strong_ms() { 1.88 if (_recent_CH_strong_roots_times_ms->num() == 0) 1.89 - return (double)G1MaxPauseTimeMS/3.0; 1.90 + return (double)MaxGCPauseMillis/3.0; 1.91 else return _recent_CH_strong_roots_times_ms->avg(); 1.92 } 1.93 1.94 double G1CollectorPolicy::recent_avg_time_for_G1_strong_ms() { 1.95 if (_recent_G1_strong_roots_times_ms->num() == 0) 1.96 - return (double)G1MaxPauseTimeMS/3.0; 1.97 + return (double)MaxGCPauseMillis/3.0; 1.98 else return _recent_G1_strong_roots_times_ms->avg(); 1.99 } 1.100 1.101 double G1CollectorPolicy::recent_avg_time_for_evac_ms() { 1.102 - if (_recent_evac_times_ms->num() == 0) return (double)G1MaxPauseTimeMS/3.0; 1.103 + if (_recent_evac_times_ms->num() == 0) return (double)MaxGCPauseMillis/3.0; 1.104 else return _recent_evac_times_ms->avg(); 1.105 } 1.106 1.107 @@ -2197,17 +2197,18 @@ 1.108 } 1.109 1.110 size_t G1CollectorPolicy::expansion_amount() { 1.111 - if ((int)(recent_avg_pause_time_ratio() * 100.0) > G1GCPct) { 1.112 - // We will double the existing space, or take G1ExpandByPctOfAvail % of 1.113 - // the available expansion space, whichever is smaller, bounded below 1.114 - // by a minimum expansion (unless that's all that's left.) 1.115 + if ((int)(recent_avg_pause_time_ratio() * 100.0) > G1GCPercent) { 1.116 + // We will double the existing space, or take 1.117 + // G1ExpandByPercentOfAvailable % of the available expansion 1.118 + // space, whichever is smaller, bounded below by a minimum 1.119 + // expansion (unless that's all that's left.) 1.120 const size_t min_expand_bytes = 1*M; 1.121 size_t reserved_bytes = _g1->g1_reserved_obj_bytes(); 1.122 size_t committed_bytes = _g1->capacity(); 1.123 size_t uncommitted_bytes = reserved_bytes - committed_bytes; 1.124 size_t expand_bytes; 1.125 size_t expand_bytes_via_pct = 1.126 - uncommitted_bytes * G1ExpandByPctOfAvail / 100; 1.127 + uncommitted_bytes * G1ExpandByPercentOfAvailable / 100; 1.128 expand_bytes = MIN2(expand_bytes_via_pct, committed_bytes); 1.129 expand_bytes = MAX2(expand_bytes, min_expand_bytes); 1.130 expand_bytes = MIN2(expand_bytes, uncommitted_bytes); 1.131 @@ -2591,7 +2592,7 @@ 1.132 // Calculates survivor space parameters. 1.133 void G1CollectorPolicy::calculate_survivors_policy() 1.134 { 1.135 - if (!G1UseSurvivorSpace) { 1.136 + if (!G1UseSurvivorSpaces) { 1.137 return; 1.138 } 1.139 if (G1FixedSurvivorSpaceSize == 0) { 1.140 @@ -2851,7 +2852,7 @@ 1.141 // estimate of the number of live bytes. 1.142 void G1CollectorPolicy:: 1.143 add_to_collection_set(HeapRegion* hr) { 1.144 - if (G1TraceRegions) { 1.145 + if (G1PrintRegions) { 1.146 gclog_or_tty->print_cr("added region to cset %d:["PTR_FORMAT", "PTR_FORMAT"], " 1.147 "top "PTR_FORMAT", young %s", 1.148 hr->hrs_index(), hr->bottom(), hr->end(),