< prev index next >

src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp

Print this page




  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1CollectedHeap.hpp"
  27 #include "gc/g1/g1HeapSizingPolicy.hpp"
  28 #include "gc/g1/g1Analytics.hpp"
  29 #include "logging/log.hpp"
  30 #include "runtime/globals.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/globalDefinitions.hpp"
  33 




  34 G1HeapSizingPolicy::G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics) :
  35   _g1h(g1h),
  36   _analytics(analytics),
  37   _num_prev_pauses_for_heuristics(analytics->number_of_recorded_pause_times()) {
  38 
  39   assert(MinOverThresholdForGrowth < _num_prev_pauses_for_heuristics, "Threshold must be less than %u", _num_prev_pauses_for_heuristics);
  40   clear_ratio_check_data();
  41 }
  42 
  43 void G1HeapSizingPolicy::clear_ratio_check_data() {
  44   _ratio_over_threshold_count = 0;
  45   _ratio_over_threshold_sum = 0.0;
  46   _pauses_since_start = 0;
  47 }
  48 
  49 size_t G1HeapSizingPolicy::expansion_amount() {
  50   double recent_gc_overhead = _analytics->recent_avg_pause_time_ratio() * 100.0;
  51   double last_gc_overhead = _analytics->last_pause_time_ratio() * 100.0;
  52   assert(GCTimeRatio > 0,
  53          "we should have set it to a default value set_g1_gc_flags() "




  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1CollectedHeap.hpp"
  27 #include "gc/g1/g1HeapSizingPolicy.hpp"
  28 #include "gc/g1/g1Analytics.hpp"
  29 #include "logging/log.hpp"
  30 #include "runtime/globals.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/globalDefinitions.hpp"
  33 
  34 G1HeapSizingPolicy* G1HeapSizingPolicy::create(const G1CollectedHeap* g1h, const G1Analytics* analytics) {
  35   return new G1HeapSizingPolicy(g1h, analytics);
  36 }
  37 
  38 G1HeapSizingPolicy::G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics) :
  39   _g1h(g1h),
  40   _analytics(analytics),
  41   _num_prev_pauses_for_heuristics(analytics->number_of_recorded_pause_times()) {
  42 
  43   assert(MinOverThresholdForGrowth < _num_prev_pauses_for_heuristics, "Threshold must be less than %u", _num_prev_pauses_for_heuristics);
  44   clear_ratio_check_data();
  45 }
  46 
  47 void G1HeapSizingPolicy::clear_ratio_check_data() {
  48   _ratio_over_threshold_count = 0;
  49   _ratio_over_threshold_sum = 0.0;
  50   _pauses_since_start = 0;
  51 }
  52 
  53 size_t G1HeapSizingPolicy::expansion_amount() {
  54   double recent_gc_overhead = _analytics->recent_avg_pause_time_ratio() * 100.0;
  55   double last_gc_overhead = _analytics->last_pause_time_ratio() * 100.0;
  56   assert(GCTimeRatio > 0,
  57          "we should have set it to a default value set_g1_gc_flags() "


< prev index next >