< prev index next >

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

Print this page
rev 59306 : imported patch 8245088-kim-stefanj-review

*** 61,90 **** } return threshold; } size_t G1HeapSizingPolicy::expansion_amount() { assert(GCTimeRatio > 0, "must be"); double long_term_pause_time_ratio = _analytics->long_term_pause_time_ratio(); double short_term_pause_time_ratio = _analytics->short_term_pause_time_ratio(); size_t expand_bytes = 0; if (_g1h->capacity() == _g1h->max_capacity()) { ! log_trace(gc, ergo, heap)("Cannot expand (heap already fully expanded) " ! "long term GC overhead: %1.2f%% committed: " SIZE_FORMAT "B", ! long_term_pause_time_ratio * 100.0, _g1h->capacity()); ! clear_ratio_check_data(); return expand_bytes; } - const double pause_time_threshold = 1.0 / (1.0 + GCTimeRatio); - - double threshold = scale_with_heap(pause_time_threshold); - // 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 // ratios. if (short_term_pause_time_ratio > threshold) { _ratio_over_threshold_count++; --- 61,106 ---- } return threshold; } + static void log_expansion(double short_term_pause_time_ratio, + double long_term_pause_time_ratio, + double threshold, + double pause_time_ratio, + bool fully_expanded, + size_t resize_bytes) { + + log_debug(gc, ergo, heap)("Heap expansion: " + "short term pause time ratio %1.2f%% long term pause time ratio %1.2f%% " + "threshold %1.2f%% pause time ratio %1.2f%% fully expanded %s " + "resize by " SIZE_FORMAT "B", + short_term_pause_time_ratio * 100.0, + long_term_pause_time_ratio * 100.0, + threshold * 100.0, + pause_time_ratio * 100.0, + BOOL_TO_STR(fully_expanded), + resize_bytes); + } + size_t G1HeapSizingPolicy::expansion_amount() { assert(GCTimeRatio > 0, "must be"); double long_term_pause_time_ratio = _analytics->long_term_pause_time_ratio(); double short_term_pause_time_ratio = _analytics->short_term_pause_time_ratio(); + const double pause_time_threshold = 1.0 / (1.0 + GCTimeRatio); + double threshold = scale_with_heap(pause_time_threshold); + size_t expand_bytes = 0; if (_g1h->capacity() == _g1h->max_capacity()) { ! log_expansion(short_term_pause_time_ratio, long_term_pause_time_ratio, ! threshold, pause_time_threshold, true, 0); clear_ratio_check_data(); return expand_bytes; } // 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 // ratios. if (short_term_pause_time_ratio > threshold) { _ratio_over_threshold_count++;
*** 156,166 **** expand_bytes = static_cast<size_t>(expand_bytes * scale_factor); // Ensure the expansion size is at least the minimum growth amount // and at most the remaining uncommitted byte size. ! expand_bytes = clamp(min_expand_bytes, expand_bytes, uncommitted_bytes); clear_ratio_check_data(); } else { // An expansion was not triggered. If we've started counting, increment // the number of checks we've made in the current window. If we've --- 172,182 ---- expand_bytes = static_cast<size_t>(expand_bytes * scale_factor); // Ensure the expansion size is at least the minimum growth amount // and at most the remaining uncommitted byte size. ! expand_bytes = clamp(expand_bytes, min_expand_bytes, uncommitted_bytes); clear_ratio_check_data(); } else { // An expansion was not triggered. If we've started counting, increment // the number of checks we've made in the current window. If we've
*** 172,181 **** clear_ratio_check_data(); } } } ! log("Heap expansion:", short_term_pause_time_ratio, long_term_pause_time_ratio, ! threshold, pause_time_ratio, false, expand_bytes); return expand_bytes; } --- 188,197 ---- clear_ratio_check_data(); } } } ! log_expansion(short_term_pause_time_ratio, long_term_pause_time_ratio, ! threshold, pause_time_threshold, false, expand_bytes); return expand_bytes; }
< prev index next >