From e52c8ad8f28b7a1a44390212ff0fe059ea1fca42 Mon Sep 17 00:00:00 2001 From: tonyp Date: Fri, 23 Mar 2012 10:53:19 -0400 Subject: [PATCH] 7146246: G1: expose some of the -XX flags that drive which old regions to collect during mixed GCs Summary: Make two G1 cmd line flags available in product builds: G1HeapWastePercent (previously called: G1OldReclaimableThresholdPercent) and G1MixedGCCountTarget (previous called: G1MaxMixedGCNum). Also changed the default of the former from 1% to 5% and the default for G1OldCSetRegionLiveThresholdPercent to 90%. Reviewed-by: azeemj, jwilhelm, johnc --- .../gc_implementation/g1/collectionSetChooser.cpp | 2 +- .../vm/gc_implementation/g1/g1CollectorPolicy.cpp | 2 +- src/share/vm/gc_implementation/g1/g1_globals.hpp | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp b/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp index fb587ea12..3a383267b 100644 --- a/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp +++ b/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp @@ -285,7 +285,7 @@ size_t CollectionSetChooser::calcMinOldCSetLength() { // that the result is the same during all mixed GCs that follow a cycle. const size_t region_num = (size_t) _length; - const size_t gc_num = (size_t) G1MaxMixedGCNum; + const size_t gc_num = (size_t) G1MixedGCCountTarget; size_t result = region_num / gc_num; // emulate ceiling if (result * gc_num < region_num) { diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index f63d79c0e..9e01add3f 100644 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -2608,7 +2608,7 @@ bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, size_t reclaimable_bytes = cset_chooser->remainingReclaimableBytes(); size_t capacity_bytes = _g1->capacity(); double perc = (double) reclaimable_bytes * 100.0 / (double) capacity_bytes; - double threshold = (double) G1OldReclaimableThresholdPercent; + double threshold = (double) G1HeapWastePercent; if (perc < threshold) { ergo_verbose4(ErgoMixedGCs, false_action_str, diff --git a/src/share/vm/gc_implementation/g1/g1_globals.hpp b/src/share/vm/gc_implementation/g1/g1_globals.hpp index 137e8df74..3de711c00 100644 --- a/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -299,17 +299,16 @@ "Percentage (0-100) of the heap size to use as maximum " \ "young gen size.") \ \ - develop(uintx, G1OldCSetRegionLiveThresholdPercent, 95, \ + develop(uintx, G1OldCSetRegionLiveThresholdPercent, 90, \ "Threshold for regions to be added to the collection set. " \ "Regions with more live bytes that this will not be collected.") \ \ - develop(uintx, G1OldReclaimableThresholdPercent, 1, \ - "Threshold for the remaining old reclaimable bytes, expressed " \ - "as a percentage of the heap size. If the old reclaimable bytes " \ - "are under this we will not collect them with more mixed GCs.") \ + product(uintx, G1HeapWastePercent, 5, \ + "Amount of space, expressed as a percentage of the heap size, " \ + "that G1 is willing not to collect to avoid expensive GCs.") \ \ - develop(uintx, G1MaxMixedGCNum, 4, \ - "The maximum desired number of mixed GCs after a marking cycle.") \ + product(uintx, G1MixedGCCountTarget, 4, \ + "The target number of mixed GCs after a marking cycle.") \ \ develop(uintx, G1OldCSetRegionThresholdPercent, 10, \ "An upper bound for the number of old CSet regions expressed " \ -- GitLab