< prev index next >

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

Print this page
rev 49525 : [mq]: 8200426-sangheon-review

*** 29,45 **** #include "logging/log.hpp" #include "runtime/globals.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" ! G1HeapSizingPolicy::G1HeapSizingPolicy(const G1CollectedHeap* g1, const G1Analytics* analytics) : ! _g1(g1), _analytics(analytics), _num_prev_pauses_for_heuristics(analytics->number_of_recorded_pause_times()) { assert(MinOverThresholdForGrowth < _num_prev_pauses_for_heuristics, "Threshold must be less than %u", _num_prev_pauses_for_heuristics); clear_ratio_check_data(); ! } void G1HeapSizingPolicy::clear_ratio_check_data() { _ratio_over_threshold_count = 0; _ratio_over_threshold_sum = 0.0; _pauses_since_start = 0; --- 29,46 ---- #include "logging/log.hpp" #include "runtime/globals.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" ! G1HeapSizingPolicy::G1HeapSizingPolicy(const G1CollectedHeap* g1h, const G1Analytics* analytics) : ! _g1h(g1h), _analytics(analytics), _num_prev_pauses_for_heuristics(analytics->number_of_recorded_pause_times()) { + assert(MinOverThresholdForGrowth < _num_prev_pauses_for_heuristics, "Threshold must be less than %u", _num_prev_pauses_for_heuristics); clear_ratio_check_data(); ! } void G1HeapSizingPolicy::clear_ratio_check_data() { _ratio_over_threshold_count = 0; _ratio_over_threshold_sum = 0.0; _pauses_since_start = 0;
*** 57,68 **** size_t expand_bytes = 0; // If the heap is at less than half its maximum size, scale the threshold down, // to a limit of 1. Thus the smaller the heap is, the more likely it is to expand, // though the scaling code will likely keep the increase small. ! if (_g1->capacity() <= _g1->max_capacity() / 2) { ! threshold *= (double)_g1->capacity() / (double)(_g1->max_capacity() / 2); threshold = MAX2(threshold, 1.0); } // If the last GC time ratio is over the threshold, increment the count of // times it has been exceeded, and add this ratio to the sum of exceeded --- 58,69 ---- size_t expand_bytes = 0; // If the heap is at less than half its maximum size, scale the threshold down, // to a limit of 1. Thus the smaller the heap is, the more likely it is to expand, // though the scaling code will likely keep the increase small. ! if (_g1h->capacity() <= _g1h->max_capacity() / 2) { ! threshold *= (double)_g1h->capacity() / (double)(_g1h->max_capacity() / 2); threshold = MAX2(threshold, 1.0); } // If the last GC time ratio is over the threshold, increment the count of // times it has been exceeded, and add this ratio to the sum of exceeded
*** 79,90 **** // long enough to make the average exceed the threshold. bool filled_history_buffer = _pauses_since_start == _num_prev_pauses_for_heuristics; if ((_ratio_over_threshold_count == MinOverThresholdForGrowth) || (filled_history_buffer && (recent_gc_overhead > threshold))) { size_t min_expand_bytes = HeapRegion::GrainBytes; ! size_t reserved_bytes = _g1->max_capacity(); ! size_t committed_bytes = _g1->capacity(); size_t uncommitted_bytes = reserved_bytes - committed_bytes; size_t expand_bytes_via_pct = uncommitted_bytes * G1ExpandByPercentOfAvailable / 100; double scale_factor = 1.0; --- 80,91 ---- // long enough to make the average exceed the threshold. bool filled_history_buffer = _pauses_since_start == _num_prev_pauses_for_heuristics; if ((_ratio_over_threshold_count == MinOverThresholdForGrowth) || (filled_history_buffer && (recent_gc_overhead > threshold))) { size_t min_expand_bytes = HeapRegion::GrainBytes; ! size_t reserved_bytes = _g1h->max_capacity(); ! size_t committed_bytes = _g1h->capacity(); size_t uncommitted_bytes = reserved_bytes - committed_bytes; size_t expand_bytes_via_pct = uncommitted_bytes * G1ExpandByPercentOfAvailable / 100; double scale_factor = 1.0;
< prev index next >