< prev index next >

src/share/vm/gc/cms/allocationStats.hpp

Print this page
rev 8978 : imported patch remove_err_msg


  88   void compute_desired(size_t count,
  89                        float inter_sweep_current,
  90                        float inter_sweep_estimate,
  91                        float intra_sweep_estimate) {
  92     // If the latest inter-sweep time is below our granularity
  93     // of measurement, we may call in here with
  94     // inter_sweep_current == 0. However, even for suitably small
  95     // but non-zero inter-sweep durations, we may not trust the accuracy
  96     // of accumulated data, since it has not been "integrated"
  97     // (read "low-pass-filtered") long enough, and would be
  98     // vulnerable to noisy glitches. In such cases, we
  99     // ignore the current sample and use currently available
 100     // historical estimates.
 101     assert(prev_sweep() + split_births() + coal_births()        // "Total Production Stock"
 102            >= split_deaths() + coal_deaths() + (ssize_t)count, // "Current stock + depletion"
 103            "Conservation Principle");
 104     if (inter_sweep_current > _threshold) {
 105       ssize_t demand = prev_sweep() - (ssize_t)count + split_births() + coal_births()
 106                        - split_deaths() - coal_deaths();
 107       assert(demand >= 0,
 108              err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for "
 109                      PTR_FORMAT " (size=" SIZE_FORMAT ")",
 110                      demand, p2i(this), count));
 111       // Defensive: adjust for imprecision in event counting
 112       if (demand < 0) {
 113         demand = 0;
 114       }
 115       float old_rate = _demand_rate_estimate.padded_average();
 116       float rate = ((float)demand)/inter_sweep_current;
 117       _demand_rate_estimate.sample(rate);
 118       float new_rate = _demand_rate_estimate.padded_average();
 119       ssize_t old_desired = _desired;
 120       float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0);
 121       _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise));
 122       if (PrintFLSStatistics > 1) {
 123         gclog_or_tty->print_cr("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, "
 124                                "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT,
 125                                 demand, old_rate, rate, new_rate, old_desired, _desired);
 126       }
 127     }
 128   }
 129 
 130   ssize_t desired() const { return _desired; }




  88   void compute_desired(size_t count,
  89                        float inter_sweep_current,
  90                        float inter_sweep_estimate,
  91                        float intra_sweep_estimate) {
  92     // If the latest inter-sweep time is below our granularity
  93     // of measurement, we may call in here with
  94     // inter_sweep_current == 0. However, even for suitably small
  95     // but non-zero inter-sweep durations, we may not trust the accuracy
  96     // of accumulated data, since it has not been "integrated"
  97     // (read "low-pass-filtered") long enough, and would be
  98     // vulnerable to noisy glitches. In such cases, we
  99     // ignore the current sample and use currently available
 100     // historical estimates.
 101     assert(prev_sweep() + split_births() + coal_births()        // "Total Production Stock"
 102            >= split_deaths() + coal_deaths() + (ssize_t)count, // "Current stock + depletion"
 103            "Conservation Principle");
 104     if (inter_sweep_current > _threshold) {
 105       ssize_t demand = prev_sweep() - (ssize_t)count + split_births() + coal_births()
 106                        - split_deaths() - coal_deaths();
 107       assert(demand >= 0,
 108              "Demand (" SSIZE_FORMAT ") should be non-negative for "
 109              PTR_FORMAT " (size=" SIZE_FORMAT ")",
 110              demand, p2i(this), count);
 111       // Defensive: adjust for imprecision in event counting
 112       if (demand < 0) {
 113         demand = 0;
 114       }
 115       float old_rate = _demand_rate_estimate.padded_average();
 116       float rate = ((float)demand)/inter_sweep_current;
 117       _demand_rate_estimate.sample(rate);
 118       float new_rate = _demand_rate_estimate.padded_average();
 119       ssize_t old_desired = _desired;
 120       float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0);
 121       _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise));
 122       if (PrintFLSStatistics > 1) {
 123         gclog_or_tty->print_cr("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, "
 124                                "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT,
 125                                 demand, old_rate, rate, new_rate, old_desired, _desired);
 126       }
 127     }
 128   }
 129 
 130   ssize_t desired() const { return _desired; }


< prev index next >