1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Jul 13 14:16:21 2012 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Mon Jul 16 13:00:26 2012 -0700 1.3 @@ -36,6 +36,7 @@ 1.4 1.5 class HeapRegion; 1.6 class CollectionSetChooser; 1.7 +class G1GCPhaseTimes; 1.8 1.9 // TraceGen0Time collects data on _both_ young and mixed evacuation pauses 1.10 // (the latter may contain non-young regions - i.e. regions that are 1.11 @@ -61,26 +62,14 @@ 1.12 NumberSeq _parallel_other; 1.13 NumberSeq _clear_ct; 1.14 1.15 - void print_summary (int level, const char* str, const NumberSeq* seq) const; 1.16 - void print_summary_sd (int level, const char* str, const NumberSeq* seq) const; 1.17 + void print_summary(const char* str, const NumberSeq* seq) const; 1.18 + void print_summary_sd(const char* str, const NumberSeq* seq) const; 1.19 1.20 public: 1.21 TraceGen0TimeData() : _young_pause_num(0), _mixed_pause_num(0) {}; 1.22 void record_start_collection(double time_to_stop_the_world_ms); 1.23 void record_yield_time(double yield_time_ms); 1.24 - void record_end_collection( 1.25 - double total_ms, 1.26 - double other_ms, 1.27 - double root_region_scan_wait_ms, 1.28 - double parallel_ms, 1.29 - double ext_root_scan_ms, 1.30 - double satb_filtering_ms, 1.31 - double update_rs_ms, 1.32 - double scan_rs_ms, 1.33 - double obj_copy_ms, 1.34 - double termination_ms, 1.35 - double parallel_other_ms, 1.36 - double clear_ct_ms); 1.37 + void record_end_collection(double pause_time_ms, G1GCPhaseTimes* phase_times); 1.38 void increment_young_collection_count(); 1.39 void increment_mixed_collection_count(); 1.40 void print() const; 1.41 @@ -186,25 +175,9 @@ 1.42 1.43 CollectionSetChooser* _collectionSetChooser; 1.44 1.45 - double _cur_collection_start_sec; 1.46 + double _full_collection_start_sec; 1.47 size_t _cur_collection_pause_used_at_start_bytes; 1.48 uint _cur_collection_pause_used_regions_at_start; 1.49 - double _cur_collection_par_time_ms; 1.50 - 1.51 - double _cur_collection_code_root_fixup_time_ms; 1.52 - 1.53 - double _cur_clear_ct_time_ms; 1.54 - double _cur_ref_proc_time_ms; 1.55 - double _cur_ref_enq_time_ms; 1.56 - 1.57 -#ifndef PRODUCT 1.58 - // Card Table Count Cache stats 1.59 - double _min_clear_cc_time_ms; // min 1.60 - double _max_clear_cc_time_ms; // max 1.61 - double _cur_clear_cc_time_ms; // clearing time during current pause 1.62 - double _cum_clear_cc_time_ms; // cummulative clearing time 1.63 - jlong _num_cc_clears; // number of times the card count cache has been cleared 1.64 -#endif 1.65 1.66 // These exclude marking times. 1.67 TruncatedSeq* _recent_gc_times_ms; 1.68 @@ -217,23 +190,6 @@ 1.69 1.70 double _stop_world_start; 1.71 1.72 - double* _par_last_gc_worker_start_times_ms; 1.73 - double* _par_last_ext_root_scan_times_ms; 1.74 - double* _par_last_satb_filtering_times_ms; 1.75 - double* _par_last_update_rs_times_ms; 1.76 - double* _par_last_update_rs_processed_buffers; 1.77 - double* _par_last_scan_rs_times_ms; 1.78 - double* _par_last_obj_copy_times_ms; 1.79 - double* _par_last_termination_times_ms; 1.80 - double* _par_last_termination_attempts; 1.81 - double* _par_last_gc_worker_end_times_ms; 1.82 - double* _par_last_gc_worker_times_ms; 1.83 - 1.84 - // Each workers 'other' time i.e. the elapsed time of the parallel 1.85 - // code executed by a worker minus the sum of the individual sub-phase 1.86 - // times for that worker thread. 1.87 - double* _par_last_gc_worker_other_times_ms; 1.88 - 1.89 // indicates whether we are in young or mixed GC mode 1.90 bool _gcs_are_young; 1.91 1.92 @@ -306,10 +262,6 @@ 1.93 1.94 size_t _recorded_rs_lengths; 1.95 size_t _max_rs_lengths; 1.96 - 1.97 - double _recorded_young_free_cset_time_ms; 1.98 - double _recorded_non_young_free_cset_time_ms; 1.99 - 1.100 double _sigma; 1.101 1.102 size_t _rs_lengths_prediction; 1.103 @@ -341,8 +293,7 @@ 1.104 void set_no_of_gc_threads(uintx v) { _no_of_gc_threads = v; } 1.105 1.106 double _pause_time_target_ms; 1.107 - double _recorded_young_cset_choice_time_ms; 1.108 - double _recorded_non_young_cset_choice_time_ms; 1.109 + 1.110 size_t _pending_cards; 1.111 size_t _max_pending_cards; 1.112 1.113 @@ -497,14 +448,6 @@ 1.114 uint young_cset_region_length() { return eden_cset_region_length() + 1.115 survivor_cset_region_length(); } 1.116 1.117 - void record_young_free_cset_time_ms(double time_ms) { 1.118 - _recorded_young_free_cset_time_ms = time_ms; 1.119 - } 1.120 - 1.121 - void record_non_young_free_cset_time_ms(double time_ms) { 1.122 - _recorded_non_young_free_cset_time_ms = time_ms; 1.123 - } 1.124 - 1.125 double predict_survivor_regions_evac_time(); 1.126 1.127 void cset_regions_freed() { 1.128 @@ -552,19 +495,6 @@ 1.129 } 1.130 1.131 private: 1.132 - void print_stats(int level, const char* str, double value); 1.133 - void print_stats(int level, const char* str, double value, int workers); 1.134 - void print_stats(int level, const char* str, int value); 1.135 - 1.136 - void print_par_stats(int level, const char* str, double* data, bool showDecimals = true); 1.137 - 1.138 - double avg_value (double* data); 1.139 - double max_value (double* data); 1.140 - double sum_of_values (double* data); 1.141 - double max_sum (double* data1, double* data2); 1.142 - 1.143 - double _last_pause_time_ms; 1.144 - 1.145 size_t _bytes_in_collection_set_before_gc; 1.146 size_t _bytes_copied_during_gc; 1.147 1.148 @@ -638,6 +568,8 @@ 1.149 // Stash a pointer to the g1 heap. 1.150 G1CollectedHeap* _g1; 1.151 1.152 + G1GCPhaseTimes* _phase_times; 1.153 + 1.154 // The ratio of gc time to elapsed time, computed over recent pauses. 1.155 double _recent_avg_pause_time_ratio; 1.156 1.157 @@ -677,7 +609,6 @@ 1.158 double _cur_mark_stop_world_time_ms; 1.159 double _mark_remark_start_sec; 1.160 double _mark_cleanup_start_sec; 1.161 - double _root_region_scan_wait_time_ms; 1.162 1.163 // Update the young list target length either by setting it to the 1.164 // desired fixed value or by calculating it using G1's pause 1.165 @@ -728,6 +659,8 @@ 1.166 return CollectorPolicy::G1CollectorPolicyKind; 1.167 } 1.168 1.169 + G1GCPhaseTimes* phase_times() const { return _phase_times; } 1.170 + 1.171 // Check the current value of the young list RSet lengths and 1.172 // compare it against the last prediction. If the current value is 1.173 // higher, recalculate the young list target length prediction. 1.174 @@ -772,10 +705,6 @@ 1.175 void record_concurrent_mark_init_end(double 1.176 mark_init_elapsed_time_ms); 1.177 1.178 - void record_root_region_scan_wait_time(double time_ms) { 1.179 - _root_region_scan_wait_time_ms = time_ms; 1.180 - } 1.181 - 1.182 void record_concurrent_mark_remark_start(); 1.183 void record_concurrent_mark_remark_end(); 1.184 1.185 @@ -784,97 +713,14 @@ 1.186 void record_concurrent_mark_cleanup_completed(); 1.187 1.188 void record_concurrent_pause(); 1.189 - void record_concurrent_pause_end(); 1.190 1.191 - void record_collection_pause_end(int no_of_gc_threads); 1.192 + void record_collection_pause_end(double pause_time); 1.193 void print_heap_transition(); 1.194 1.195 // Record the fact that a full collection occurred. 1.196 void record_full_collection_start(); 1.197 void record_full_collection_end(); 1.198 1.199 - void record_gc_worker_start_time(int worker_i, double ms) { 1.200 - _par_last_gc_worker_start_times_ms[worker_i] = ms; 1.201 - } 1.202 - 1.203 - void record_ext_root_scan_time(int worker_i, double ms) { 1.204 - _par_last_ext_root_scan_times_ms[worker_i] = ms; 1.205 - } 1.206 - 1.207 - void record_satb_filtering_time(int worker_i, double ms) { 1.208 - _par_last_satb_filtering_times_ms[worker_i] = ms; 1.209 - } 1.210 - 1.211 - void record_update_rs_time(int thread, double ms) { 1.212 - _par_last_update_rs_times_ms[thread] = ms; 1.213 - } 1.214 - 1.215 - void record_update_rs_processed_buffers (int thread, 1.216 - double processed_buffers) { 1.217 - _par_last_update_rs_processed_buffers[thread] = processed_buffers; 1.218 - } 1.219 - 1.220 - void record_scan_rs_time(int thread, double ms) { 1.221 - _par_last_scan_rs_times_ms[thread] = ms; 1.222 - } 1.223 - 1.224 - void reset_obj_copy_time(int thread) { 1.225 - _par_last_obj_copy_times_ms[thread] = 0.0; 1.226 - } 1.227 - 1.228 - void reset_obj_copy_time() { 1.229 - reset_obj_copy_time(0); 1.230 - } 1.231 - 1.232 - void record_obj_copy_time(int thread, double ms) { 1.233 - _par_last_obj_copy_times_ms[thread] += ms; 1.234 - } 1.235 - 1.236 - void record_termination(int thread, double ms, size_t attempts) { 1.237 - _par_last_termination_times_ms[thread] = ms; 1.238 - _par_last_termination_attempts[thread] = (double) attempts; 1.239 - } 1.240 - 1.241 - void record_gc_worker_end_time(int worker_i, double ms) { 1.242 - _par_last_gc_worker_end_times_ms[worker_i] = ms; 1.243 - } 1.244 - 1.245 - void record_pause_time_ms(double ms) { 1.246 - _last_pause_time_ms = ms; 1.247 - } 1.248 - 1.249 - void record_clear_ct_time(double ms) { 1.250 - _cur_clear_ct_time_ms = ms; 1.251 - } 1.252 - 1.253 - void record_par_time(double ms) { 1.254 - _cur_collection_par_time_ms = ms; 1.255 - } 1.256 - 1.257 - void record_code_root_fixup_time(double ms) { 1.258 - _cur_collection_code_root_fixup_time_ms = ms; 1.259 - } 1.260 - 1.261 - void record_ref_proc_time(double ms) { 1.262 - _cur_ref_proc_time_ms = ms; 1.263 - } 1.264 - 1.265 - void record_ref_enq_time(double ms) { 1.266 - _cur_ref_enq_time_ms = ms; 1.267 - } 1.268 - 1.269 -#ifndef PRODUCT 1.270 - void record_cc_clear_time(double ms) { 1.271 - if (_min_clear_cc_time_ms < 0.0 || ms <= _min_clear_cc_time_ms) 1.272 - _min_clear_cc_time_ms = ms; 1.273 - if (_max_clear_cc_time_ms < 0.0 || ms >= _max_clear_cc_time_ms) 1.274 - _max_clear_cc_time_ms = ms; 1.275 - _cur_clear_cc_time_ms = ms; 1.276 - _cum_clear_cc_time_ms += ms; 1.277 - _num_cc_clears++; 1.278 - } 1.279 -#endif 1.280 - 1.281 // Record how much space we copied during a GC. This is typically 1.282 // called when a GC alloc region is being retired. 1.283 void record_bytes_copied_during_gc(size_t bytes) {