< prev index next >

src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp

Print this page
rev 7854 : imported patch 8027962-per-phase-timing-measurements-for-strong-roots-processing
rev 7855 : [mq]: 8027962-bengt-suggestions
   1 /*
   2  * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  90     return _sum;
  91   }
  92 
  93   void print(int level, const char* title);
  94 
  95   void reset() PRODUCT_RETURN;
  96   void verify() PRODUCT_RETURN;
  97 
  98  private:
  99 
 100   void calculate_totals(){
 101     _sum = (T)0;
 102     for (uint i = 0; i < _length; ++i) {
 103       _sum += _data[i];
 104     }
 105     _average = (double)_sum / (double)_length;
 106     _has_new_data = false;
 107   }
 108 };
 109 

















 110 class G1GCPhaseTimes : public CHeapObj<mtGC> {
 111 
 112  private:
 113   uint _active_gc_threads;
 114   uint _max_gc_threads;



 115 
 116   WorkerDataArray<double> _last_gc_worker_start_times_ms;
 117   WorkerDataArray<double> _last_ext_root_scan_times_ms;

 118   WorkerDataArray<double> _last_satb_filtering_times_ms;
 119   WorkerDataArray<double> _last_update_rs_times_ms;
 120   WorkerDataArray<int>    _last_update_rs_processed_buffers;
 121   WorkerDataArray<double> _last_scan_rs_times_ms;
 122   WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
 123   WorkerDataArray<double> _last_obj_copy_times_ms;
 124   WorkerDataArray<double> _last_termination_times_ms;
 125   WorkerDataArray<size_t> _last_termination_attempts;
 126   WorkerDataArray<double> _last_gc_worker_end_times_ms;
 127   WorkerDataArray<double> _last_gc_worker_times_ms;
 128   WorkerDataArray<double> _last_gc_worker_other_times_ms;
 129 
 130   double _cur_collection_par_time_ms;
 131   double _cur_collection_code_root_fixup_time_ms;
 132   double _cur_strong_code_root_purge_time_ms;
 133 
 134   double _cur_evac_fail_recalc_used;
 135   double _cur_evac_fail_restore_remsets;
 136   double _cur_evac_fail_remove_self_forwards;
 137 


 154   double _recorded_redirty_logged_cards_time_ms;
 155 
 156   double _recorded_young_free_cset_time_ms;
 157   double _recorded_non_young_free_cset_time_ms;
 158 
 159   double _cur_fast_reclaim_humongous_time_ms;
 160   double _cur_fast_reclaim_humongous_register_time_ms;
 161   size_t _cur_fast_reclaim_humongous_total;
 162   size_t _cur_fast_reclaim_humongous_candidates;
 163   size_t _cur_fast_reclaim_humongous_reclaimed;
 164 
 165   double _cur_verify_before_time_ms;
 166   double _cur_verify_after_time_ms;
 167 
 168   // Helper methods for detailed logging
 169   void print_stats(int level, const char* str, double value);
 170   void print_stats(int level, const char* str, size_t value);
 171   void print_stats(int level, const char* str, double value, uint workers);
 172 
 173  public:
 174   G1GCPhaseTimes(uint max_gc_threads);





 175   void note_gc_start(uint active_gc_threads);
 176   void note_gc_end();
 177   void print(double pause_time_sec);
 178 
 179   void record_gc_worker_start_time(uint worker_i, double ms) {
 180     _last_gc_worker_start_times_ms.set(worker_i, ms);
 181   }
 182 
 183   void record_ext_root_scan_time(uint worker_i, double ms) {
 184     _last_ext_root_scan_times_ms.set(worker_i, ms);
 185   }
 186 
 187   void record_satb_filtering_time(uint worker_i, double ms) {
 188     _last_satb_filtering_times_ms.set(worker_i, ms);
 189   }
 190 
 191   void record_update_rs_time(uint worker_i, double ms) {
 192     _last_update_rs_times_ms.set(worker_i, ms);
 193   }
 194 


   1 /*
   2  * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  90     return _sum;
  91   }
  92 
  93   void print(int level, const char* title);
  94 
  95   void reset() PRODUCT_RETURN;
  96   void verify() PRODUCT_RETURN;
  97 
  98  private:
  99 
 100   void calculate_totals(){
 101     _sum = (T)0;
 102     for (uint i = 0; i < _length; ++i) {
 103       _sum += _data[i];
 104     }
 105     _average = (double)_sum / (double)_length;
 106     _has_new_data = false;
 107   }
 108 };
 109 
 110 class GCPhaseTimeData : public PhaseTimeData {
 111 private:
 112   WorkerDataArray<double>** _data;
 113   uint _num_phases;
 114   uint _worker_id;
 115 public:
 116   GCPhaseTimeData(WorkerDataArray<double>** data, uint num_phases, uint worker_id) :
 117     _data(data), _num_phases(num_phases), _worker_id(worker_id) { }
 118 
 119   virtual bool active() const { return _num_phases > 0; }
 120 
 121   virtual void set_value(uint phase, double value) {
 122     assert(_data != NULL, "just checking");
 123     _data[phase]->set(_worker_id, value);
 124   }
 125 };
 126 
 127 class G1GCPhaseTimes : public CHeapObj<mtGC> {
 128 
 129  private:
 130   uint _active_gc_threads;
 131   uint _max_gc_threads;
 132   uint _num_ext_root_scan_phases;
 133 
 134   bool track_ext_root_scan_phases() const { return _num_ext_root_scan_phases > 0; }
 135 
 136   WorkerDataArray<double> _last_gc_worker_start_times_ms;
 137   WorkerDataArray<double> _last_ext_root_scan_times_ms;
 138   WorkerDataArray<double>** _last_ext_root_scan_phase_times_ms;
 139   WorkerDataArray<double> _last_satb_filtering_times_ms;
 140   WorkerDataArray<double> _last_update_rs_times_ms;
 141   WorkerDataArray<int>    _last_update_rs_processed_buffers;
 142   WorkerDataArray<double> _last_scan_rs_times_ms;
 143   WorkerDataArray<double> _last_strong_code_root_scan_times_ms;
 144   WorkerDataArray<double> _last_obj_copy_times_ms;
 145   WorkerDataArray<double> _last_termination_times_ms;
 146   WorkerDataArray<size_t> _last_termination_attempts;
 147   WorkerDataArray<double> _last_gc_worker_end_times_ms;
 148   WorkerDataArray<double> _last_gc_worker_times_ms;
 149   WorkerDataArray<double> _last_gc_worker_other_times_ms;
 150 
 151   double _cur_collection_par_time_ms;
 152   double _cur_collection_code_root_fixup_time_ms;
 153   double _cur_strong_code_root_purge_time_ms;
 154 
 155   double _cur_evac_fail_recalc_used;
 156   double _cur_evac_fail_restore_remsets;
 157   double _cur_evac_fail_remove_self_forwards;
 158 


 175   double _recorded_redirty_logged_cards_time_ms;
 176 
 177   double _recorded_young_free_cset_time_ms;
 178   double _recorded_non_young_free_cset_time_ms;
 179 
 180   double _cur_fast_reclaim_humongous_time_ms;
 181   double _cur_fast_reclaim_humongous_register_time_ms;
 182   size_t _cur_fast_reclaim_humongous_total;
 183   size_t _cur_fast_reclaim_humongous_candidates;
 184   size_t _cur_fast_reclaim_humongous_reclaimed;
 185 
 186   double _cur_verify_before_time_ms;
 187   double _cur_verify_after_time_ms;
 188 
 189   // Helper methods for detailed logging
 190   void print_stats(int level, const char* str, double value);
 191   void print_stats(int level, const char* str, size_t value);
 192   void print_stats(int level, const char* str, double value, uint workers);
 193 
 194  public:
 195   G1GCPhaseTimes(uint max_gc_threads, uint num_ext_root_scan_phases);
 196   virtual ~G1GCPhaseTimes();
 197 
 198   WorkerDataArray<double>** get_ext_root_scan_phase_times() const { return _last_ext_root_scan_phase_times_ms; }
 199   uint num_ext_root_scan_phases() const { return _num_ext_root_scan_phases; }
 200 
 201   void note_gc_start(uint active_gc_threads);
 202   void note_gc_end();
 203   void print(double pause_time_sec);
 204 
 205   void record_gc_worker_start_time(uint worker_i, double ms) {
 206     _last_gc_worker_start_times_ms.set(worker_i, ms);
 207   }
 208 
 209   void record_ext_root_scan_time(uint worker_i, double ms) {
 210     _last_ext_root_scan_times_ms.set(worker_i, ms);
 211   }
 212 
 213   void record_satb_filtering_time(uint worker_i, double ms) {
 214     _last_satb_filtering_times_ms.set(worker_i, ms);
 215   }
 216 
 217   void record_update_rs_time(uint worker_i, double ms) {
 218     _last_update_rs_times_ms.set(worker_i, ms);
 219   }
 220 


< prev index next >