# HG changeset patch # User mgerdin # Date 1454570546 -3600 # Thu Feb 04 08:22:26 2016 +0100 # Node ID 49674f7cd90838ecbfae9045fad95dfcad91cdc3 # Parent cff975a4c46e84a197ea1e70a2fefa8ae5aa4175 8149013: Remove unused and dead code from G1CollectorPolicy Reviewed-by: diff --git a/src/share/vm/gc/g1/concurrentMark.cpp b/src/share/vm/gc/g1/concurrentMark.cpp --- a/src/share/vm/gc/g1/concurrentMark.cpp +++ b/src/share/vm/gc/g1/concurrentMark.cpp @@ -2658,9 +2658,6 @@ // We take a break if someone is trying to stop the world. bool ConcurrentMark::do_yield_check(uint worker_id) { if (SuspendibleThreadSet::should_yield()) { - if (worker_id == 0) { - _g1h->g1_policy()->record_concurrent_pause(); - } SuspendibleThreadSet::yield(); return true; } else { diff --git a/src/share/vm/gc/g1/g1CollectedHeap.cpp b/src/share/vm/gc/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -2778,12 +2778,6 @@ } void G1CollectedHeap::print_tracing_info() const { - // We'll overload this to mean "trace GC pause statistics." - if (TraceYoungGenTime || TraceOldGenTime) { - // The "G1CollectorPolicy" is keeping track of these stats, so delegate - // to that. - g1_policy()->print_tracing_info(); - } g1_rem_set()->print_summary_info(); concurrent_mark()->print_summary_info(); g1_policy()->print_yg_surv_rate_info(); @@ -2909,7 +2903,6 @@ bool* succeeded, GCCause::Cause gc_cause) { assert_heap_not_locked_and_not_at_safepoint(); - g1_policy()->record_stop_world_start(); VM_G1IncCollectionPause op(gc_count_before, word_size, false, /* should_initiate_conc_mark */ diff --git a/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/src/share/vm/gc/g1/g1CollectorPolicy.cpp --- a/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -81,10 +81,8 @@ G1CollectorPolicy::G1CollectorPolicy() : _predictor(G1ConfidencePercent / 100.0), - _parallel_gc_threads(ParallelGCThreads), _recent_gc_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), - _stop_world_start(0.0), _concurrent_mark_remark_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), _concurrent_mark_cleanup_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), @@ -172,9 +170,9 @@ _prev_collection_pause_end_ms = os::elapsedTime() * 1000.0; clear_ratio_check_data(); - _phase_times = new G1GCPhaseTimes(_parallel_gc_threads); + _phase_times = new G1GCPhaseTimes(ParallelGCThreads); - int index = MIN2(_parallel_gc_threads - 1, 7); + int index = MIN2(ParallelGCThreads - 1, 7u); _rs_length_diff_seq->add(rs_length_diff_defaults[index]); _cost_per_card_ms_seq->add(cost_per_card_ms_defaults[index]); @@ -811,8 +809,6 @@ double full_gc_time_sec = end_sec - _full_collection_start_sec; double full_gc_time_ms = full_gc_time_sec * 1000.0; - _trace_old_gen_time_data.record_full_collection(full_gc_time_ms); - update_recent_gc_times(end_sec, full_gc_time_ms); collector_state()->set_full_collection(false); @@ -843,10 +839,6 @@ record_pause(FullGC, _full_collection_start_sec, end_sec); } -void G1CollectorPolicy::record_stop_world_start() { - _stop_world_start = os::elapsedTime(); -} - void G1CollectorPolicy::record_collection_pause_start(double start_time_sec) { // We only need to do this here as the policy will only be applied // to the GC we're about to start. so, no point is calculating this @@ -857,10 +849,6 @@ "sanity, used: " SIZE_FORMAT " recalculate_used: " SIZE_FORMAT, _g1->used(), _g1->recalculate_used()); - double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0; - _trace_young_gen_time_data.record_start_collection(s_w_t_ms); - _stop_world_start = 0.0; - phase_times()->record_cur_collection_start_sec(start_time_sec); _pending_cards = _g1->pending_card_num(); @@ -912,13 +900,6 @@ collector_state()->set_in_marking_window(false); } -void G1CollectorPolicy::record_concurrent_pause() { - if (_stop_world_start > 0.0) { - double yield_ms = (os::elapsedTime() - _stop_world_start) * 1000.0; - _trace_young_gen_time_data.record_yield_time(yield_ms); - } -} - double G1CollectorPolicy::average_time_ms(G1GCPhaseTimes::GCParPhases phase) const { return phase_times()->average_time_ms(phase); } @@ -1003,7 +984,6 @@ } if (update_stats) { - _trace_young_gen_time_data.record_end_collection(pause_time_ms, phase_times()); // We maintain the invariant that all objects allocated by mutator // threads will be allocated out of eden regions. So, we can use // the eden region number allocated since the previous GC to @@ -1593,11 +1573,6 @@ return expand_bytes; } -void G1CollectorPolicy::print_tracing_info() const { - _trace_young_gen_time_data.print(); - _trace_old_gen_time_data.print(); -} - void G1CollectorPolicy::print_yg_surv_rate_info() const { #ifndef PRODUCT _short_lived_surv_rate_group->print_surv_rate_summary(); @@ -2125,12 +2100,6 @@ collector_state()->set_last_gc_was_young(collector_state()->gcs_are_young()); - if (collector_state()->last_gc_was_young()) { - _trace_young_gen_time_data.increment_young_collection_count(); - } else { - _trace_young_gen_time_data.increment_mixed_collection_count(); - } - // The young list is laid with the survivor regions from the previous // pause are appended to the RHS of the young list, i.e. // [Newly Young Regions ++ Survivors from last pause]. @@ -2270,127 +2239,3 @@ double non_young_end_time_sec = os::elapsedTime(); phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0); } - -void TraceYoungGenTimeData::record_start_collection(double time_to_stop_the_world_ms) { - if(TraceYoungGenTime) { - _all_stop_world_times_ms.add(time_to_stop_the_world_ms); - } -} - -void TraceYoungGenTimeData::record_yield_time(double yield_time_ms) { - if(TraceYoungGenTime) { - _all_yield_times_ms.add(yield_time_ms); - } -} - -void TraceYoungGenTimeData::record_end_collection(double pause_time_ms, G1GCPhaseTimes* phase_times) { - if(TraceYoungGenTime) { - _total.add(pause_time_ms); - _other.add(pause_time_ms - phase_times->accounted_time_ms()); - _root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms()); - _parallel.add(phase_times->cur_collection_par_time_ms()); - _ext_root_scan.add(phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan)); - _satb_filtering.add(phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering)); - _update_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS)); - _scan_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::ScanRS)); - _obj_copy.add(phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy)); - _termination.add(phase_times->average_time_ms(G1GCPhaseTimes::Termination)); - - double parallel_known_time = phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan) + - phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering) + - phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS) + - phase_times->average_time_ms(G1GCPhaseTimes::ScanRS) + - phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy) + - phase_times->average_time_ms(G1GCPhaseTimes::Termination); - - double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time; - _parallel_other.add(parallel_other_time); - _clear_ct.add(phase_times->cur_clear_ct_time_ms()); - } -} - -void TraceYoungGenTimeData::increment_young_collection_count() { - if(TraceYoungGenTime) { - ++_young_pause_num; - } -} - -void TraceYoungGenTimeData::increment_mixed_collection_count() { - if(TraceYoungGenTime) { - ++_mixed_pause_num; - } -} - -void TraceYoungGenTimeData::print_summary(const char* str, - const NumberSeq* seq) const { - double sum = seq->sum(); - tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)", - str, sum / 1000.0, seq->avg()); -} - -void TraceYoungGenTimeData::print_summary_sd(const char* str, - const NumberSeq* seq) const { - print_summary(str, seq); - tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", - "(num", seq->num(), seq->sd(), seq->maximum()); -} - -void TraceYoungGenTimeData::print() const { - if (!TraceYoungGenTime) { - return; - } - - tty->print_cr("ALL PAUSES"); - print_summary_sd(" Total", &_total); - tty->cr(); - tty->cr(); - tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); - tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); - tty->cr(); - - tty->print_cr("EVACUATION PAUSES"); - - if (_young_pause_num == 0 && _mixed_pause_num == 0) { - tty->print_cr("none"); - } else { - print_summary_sd(" Evacuation Pauses", &_total); - print_summary(" Root Region Scan Wait", &_root_region_scan_wait); - print_summary(" Parallel Time", &_parallel); - print_summary(" Ext Root Scanning", &_ext_root_scan); - print_summary(" SATB Filtering", &_satb_filtering); - print_summary(" Update RS", &_update_rs); - print_summary(" Scan RS", &_scan_rs); - print_summary(" Object Copy", &_obj_copy); - print_summary(" Termination", &_termination); - print_summary(" Parallel Other", &_parallel_other); - print_summary(" Clear CT", &_clear_ct); - print_summary(" Other", &_other); - } - tty->cr(); - - tty->print_cr("MISC"); - print_summary_sd(" Stop World", &_all_stop_world_times_ms); - print_summary_sd(" Yields", &_all_yield_times_ms); -} - -void TraceOldGenTimeData::record_full_collection(double full_gc_time_ms) { - if (TraceOldGenTime) { - _all_full_gc_times.add(full_gc_time_ms); - } -} - -void TraceOldGenTimeData::print() const { - if (!TraceOldGenTime) { - return; - } - - if (_all_full_gc_times.num() > 0) { - tty->print("\n%4d full_gcs: total time = %8.2f s", - _all_full_gc_times.num(), - _all_full_gc_times.sum() / 1000.0); - tty->print_cr(" (avg = %8.2fms).", _all_full_gc_times.avg()); - tty->print_cr(" [std. dev = %8.2f ms, max = %8.2f ms]", - _all_full_gc_times.sd(), - _all_full_gc_times.maximum()); - } -} diff --git a/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/src/share/vm/gc/g1/g1CollectorPolicy.hpp --- a/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -44,52 +44,6 @@ class CollectionSetChooser; class G1IHOPControl; -// TraceYoungGenTime collects data on _both_ young and mixed evacuation pauses -// (the latter may contain non-young regions - i.e. regions that are -// technically in old) while TraceOldGenTime collects data about full GCs. -class TraceYoungGenTimeData : public CHeapObj { - private: - unsigned _young_pause_num; - unsigned _mixed_pause_num; - - NumberSeq _all_stop_world_times_ms; - NumberSeq _all_yield_times_ms; - - NumberSeq _total; - NumberSeq _other; - NumberSeq _root_region_scan_wait; - NumberSeq _parallel; - NumberSeq _ext_root_scan; - NumberSeq _satb_filtering; - NumberSeq _update_rs; - NumberSeq _scan_rs; - NumberSeq _obj_copy; - NumberSeq _termination; - NumberSeq _parallel_other; - NumberSeq _clear_ct; - - void print_summary(const char* str, const NumberSeq* seq) const; - void print_summary_sd(const char* str, const NumberSeq* seq) const; - -public: - TraceYoungGenTimeData() : _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 pause_time_ms, G1GCPhaseTimes* phase_times); - void increment_young_collection_count(); - void increment_mixed_collection_count(); - void print() const; -}; - -class TraceOldGenTimeData : public CHeapObj { - private: - NumberSeq _all_full_gc_times; - - public: - void record_full_collection(double full_gc_time_ms); - void print() const; -}; - // There are three command line options related to the young gen size: // NewSize, MaxNewSize and NewRatio (There is also -Xmn, but that is // just a short form for NewSize==MaxNewSize). G1 will use its internal @@ -181,13 +135,6 @@ double get_new_prediction(TruncatedSeq const* seq) const; size_t get_new_size_prediction(TruncatedSeq const* seq) const; - // either equal to the number of parallel threads, if ParallelGCThreads - // has been set, or 1 otherwise - int _parallel_gc_threads; - - // The number of GC threads currently active. - uintx _no_of_gc_threads; - G1MMUTracker* _mmu_tracker; void initialize_alignments(); @@ -208,11 +155,6 @@ double _ratio_over_threshold_sum; uint _pauses_since_start; - TraceYoungGenTimeData _trace_young_gen_time_data; - TraceOldGenTimeData _trace_old_gen_time_data; - - double _stop_world_start; - uint _young_list_target_length; uint _young_list_fixed_length; @@ -286,9 +228,6 @@ double update_rs_processed_buffers, double goal_ms); - uintx no_of_gc_threads() { return _no_of_gc_threads; } - void set_no_of_gc_threads(uintx v) { _no_of_gc_threads = v; } - double _pause_time_target_ms; size_t _pending_cards; @@ -656,9 +595,6 @@ virtual void print_phases(); - void record_stop_world_start(); - void record_concurrent_pause(); - // 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) { @@ -768,9 +704,6 @@ // Clear ratio tracking data used by expansion_amount(). void clear_ratio_check_data(); - // Print tracing information. - void print_tracing_info() const; - // Print stats on young survival ratio void print_yg_surv_rate_info() const;