diff -r 603ef19adcb8 -r 331d5b6725f3 hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Mon Jul 02 10:54:17 2012 -0400 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Wed Jul 11 22:47:38 2012 +0200 @@ -36,6 +36,7 @@ class HeapRegion; class CollectionSetChooser; +class G1GCPhaseTimes; // TraceGen0Time collects data on _both_ young and mixed evacuation pauses // (the latter may contain non-young regions - i.e. regions that are @@ -61,26 +62,14 @@ NumberSeq _parallel_other; NumberSeq _clear_ct; - void print_summary (int level, const char* str, const NumberSeq* seq) const; - void print_summary_sd (int level, const char* str, const NumberSeq* seq) const; + void print_summary(const char* str, const NumberSeq* seq) const; + void print_summary_sd(const char* str, const NumberSeq* seq) const; public: TraceGen0TimeData() : _young_pause_num(0), _mixed_pause_num(0) {}; void record_start_collection(double time_to_stop_the_world_ms); void record_yield_time(double yield_time_ms); - void record_end_collection( - double total_ms, - double other_ms, - double root_region_scan_wait_ms, - double parallel_ms, - double ext_root_scan_ms, - double satb_filtering_ms, - double update_rs_ms, - double scan_rs_ms, - double obj_copy_ms, - double termination_ms, - double parallel_other_ms, - double clear_ct_ms); + void record_end_collection(double pause_time_ms, G1GCPhaseTimes* phase_times); void increment_young_collection_count(); void increment_mixed_collection_count(); void print() const; @@ -186,25 +175,9 @@ CollectionSetChooser* _collectionSetChooser; - double _cur_collection_start_sec; + double _full_collection_start_sec; size_t _cur_collection_pause_used_at_start_bytes; uint _cur_collection_pause_used_regions_at_start; - double _cur_collection_par_time_ms; - - double _cur_collection_code_root_fixup_time_ms; - - double _cur_clear_ct_time_ms; - double _cur_ref_proc_time_ms; - double _cur_ref_enq_time_ms; - -#ifndef PRODUCT - // Card Table Count Cache stats - double _min_clear_cc_time_ms; // min - double _max_clear_cc_time_ms; // max - double _cur_clear_cc_time_ms; // clearing time during current pause - double _cum_clear_cc_time_ms; // cummulative clearing time - jlong _num_cc_clears; // number of times the card count cache has been cleared -#endif // These exclude marking times. TruncatedSeq* _recent_gc_times_ms; @@ -217,23 +190,6 @@ double _stop_world_start; - double* _par_last_gc_worker_start_times_ms; - double* _par_last_ext_root_scan_times_ms; - double* _par_last_satb_filtering_times_ms; - double* _par_last_update_rs_times_ms; - double* _par_last_update_rs_processed_buffers; - double* _par_last_scan_rs_times_ms; - double* _par_last_obj_copy_times_ms; - double* _par_last_termination_times_ms; - double* _par_last_termination_attempts; - double* _par_last_gc_worker_end_times_ms; - double* _par_last_gc_worker_times_ms; - - // Each workers 'other' time i.e. the elapsed time of the parallel - // code executed by a worker minus the sum of the individual sub-phase - // times for that worker thread. - double* _par_last_gc_worker_other_times_ms; - // indicates whether we are in young or mixed GC mode bool _gcs_are_young; @@ -306,10 +262,6 @@ size_t _recorded_rs_lengths; size_t _max_rs_lengths; - - double _recorded_young_free_cset_time_ms; - double _recorded_non_young_free_cset_time_ms; - double _sigma; size_t _rs_lengths_prediction; @@ -341,8 +293,7 @@ void set_no_of_gc_threads(uintx v) { _no_of_gc_threads = v; } double _pause_time_target_ms; - double _recorded_young_cset_choice_time_ms; - double _recorded_non_young_cset_choice_time_ms; + size_t _pending_cards; size_t _max_pending_cards; @@ -497,14 +448,6 @@ uint young_cset_region_length() { return eden_cset_region_length() + survivor_cset_region_length(); } - void record_young_free_cset_time_ms(double time_ms) { - _recorded_young_free_cset_time_ms = time_ms; - } - - void record_non_young_free_cset_time_ms(double time_ms) { - _recorded_non_young_free_cset_time_ms = time_ms; - } - double predict_survivor_regions_evac_time(); void cset_regions_freed() { @@ -552,19 +495,6 @@ } private: - void print_stats(int level, const char* str, double value); - void print_stats(int level, const char* str, double value, int workers); - void print_stats(int level, const char* str, int value); - - void print_par_stats(int level, const char* str, double* data, bool showDecimals = true); - - double avg_value (double* data); - double max_value (double* data); - double sum_of_values (double* data); - double max_sum (double* data1, double* data2); - - double _last_pause_time_ms; - size_t _bytes_in_collection_set_before_gc; size_t _bytes_copied_during_gc; @@ -638,6 +568,8 @@ // Stash a pointer to the g1 heap. G1CollectedHeap* _g1; + G1GCPhaseTimes* _phase_times; + // The ratio of gc time to elapsed time, computed over recent pauses. double _recent_avg_pause_time_ratio; @@ -677,7 +609,6 @@ double _cur_mark_stop_world_time_ms; double _mark_remark_start_sec; double _mark_cleanup_start_sec; - double _root_region_scan_wait_time_ms; // Update the young list target length either by setting it to the // desired fixed value or by calculating it using G1's pause @@ -728,6 +659,8 @@ return CollectorPolicy::G1CollectorPolicyKind; } + G1GCPhaseTimes* phase_times() const { return _phase_times; } + // Check the current value of the young list RSet lengths and // compare it against the last prediction. If the current value is // higher, recalculate the young list target length prediction. @@ -772,10 +705,6 @@ void record_concurrent_mark_init_end(double mark_init_elapsed_time_ms); - void record_root_region_scan_wait_time(double time_ms) { - _root_region_scan_wait_time_ms = time_ms; - } - void record_concurrent_mark_remark_start(); void record_concurrent_mark_remark_end(); @@ -784,97 +713,14 @@ void record_concurrent_mark_cleanup_completed(); void record_concurrent_pause(); - void record_concurrent_pause_end(); - void record_collection_pause_end(int no_of_gc_threads); + void record_collection_pause_end(double pause_time); void print_heap_transition(); // Record the fact that a full collection occurred. void record_full_collection_start(); void record_full_collection_end(); - void record_gc_worker_start_time(int worker_i, double ms) { - _par_last_gc_worker_start_times_ms[worker_i] = ms; - } - - void record_ext_root_scan_time(int worker_i, double ms) { - _par_last_ext_root_scan_times_ms[worker_i] = ms; - } - - void record_satb_filtering_time(int worker_i, double ms) { - _par_last_satb_filtering_times_ms[worker_i] = ms; - } - - void record_update_rs_time(int thread, double ms) { - _par_last_update_rs_times_ms[thread] = ms; - } - - void record_update_rs_processed_buffers (int thread, - double processed_buffers) { - _par_last_update_rs_processed_buffers[thread] = processed_buffers; - } - - void record_scan_rs_time(int thread, double ms) { - _par_last_scan_rs_times_ms[thread] = ms; - } - - void reset_obj_copy_time(int thread) { - _par_last_obj_copy_times_ms[thread] = 0.0; - } - - void reset_obj_copy_time() { - reset_obj_copy_time(0); - } - - void record_obj_copy_time(int thread, double ms) { - _par_last_obj_copy_times_ms[thread] += ms; - } - - void record_termination(int thread, double ms, size_t attempts) { - _par_last_termination_times_ms[thread] = ms; - _par_last_termination_attempts[thread] = (double) attempts; - } - - void record_gc_worker_end_time(int worker_i, double ms) { - _par_last_gc_worker_end_times_ms[worker_i] = ms; - } - - void record_pause_time_ms(double ms) { - _last_pause_time_ms = ms; - } - - void record_clear_ct_time(double ms) { - _cur_clear_ct_time_ms = ms; - } - - void record_par_time(double ms) { - _cur_collection_par_time_ms = ms; - } - - void record_code_root_fixup_time(double ms) { - _cur_collection_code_root_fixup_time_ms = ms; - } - - void record_ref_proc_time(double ms) { - _cur_ref_proc_time_ms = ms; - } - - void record_ref_enq_time(double ms) { - _cur_ref_enq_time_ms = ms; - } - -#ifndef PRODUCT - void record_cc_clear_time(double ms) { - if (_min_clear_cc_time_ms < 0.0 || ms <= _min_clear_cc_time_ms) - _min_clear_cc_time_ms = ms; - if (_max_clear_cc_time_ms < 0.0 || ms >= _max_clear_cc_time_ms) - _max_clear_cc_time_ms = ms; - _cur_clear_cc_time_ms = ms; - _cum_clear_cc_time_ms += ms; - _num_cc_clears++; - } -#endif - // Record how much space we copied during a GC. This is typically // called when a GC alloc region is being retired. void record_bytes_copied_during_gc(size_t bytes) {