6928073: G1: use existing command line parameters for marking cycle initiation
authortonyp
Tue, 23 Feb 2010 23:14:34 -0500
changeset 5034 a1cec6310394
parent 5033 55f476a32544
child 5035 0e498c4df637
6928073: G1: use existing command line parameters for marking cycle initiation Summary: replace the combination of the G1SteadyStateUsed / G1SteadyStateUsedDelta parameteres to decide the marking initiation threshold and instead use InitiatingHeapOccupancyPercent. Reviewed-by: ysr, johnc
hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/globals.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Feb 23 23:13:23 2010 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Feb 23 23:14:34 2010 -0500
@@ -299,10 +299,6 @@
 
   assert(Heap_lock->owned_by_self(), "Locking discipline.");
 
-  if (G1SteadyStateUsed < 50) {
-    vm_exit_during_initialization("G1SteadyStateUsed must be at least 50%.");
-  }
-
   initialize_gc_policy_counters();
 
   if (G1Gen) {
@@ -1425,7 +1421,7 @@
       record_concurrent_mark_init_end_pre(0.0);
 
     size_t min_used_targ =
-      (_g1->capacity() / 100) * (G1SteadyStateUsed - G1SteadyStateUsedDelta);
+      (_g1->capacity() / 100) * InitiatingHeapOccupancyPercent;
 
     if (cur_used_bytes > min_used_targ) {
       if (cur_used_bytes <= _prev_collection_pause_used_at_end_bytes) {
@@ -2618,13 +2614,6 @@
 G1CollectorPolicy_BestRegionsFirst::should_do_collection_pause(size_t
                                                                word_size) {
   assert(_g1->regions_accounted_for(), "Region leakage!");
-  // Initiate a pause when we reach the steady-state "used" target.
-  size_t used_hard = (_g1->capacity() / 100) * G1SteadyStateUsed;
-  size_t used_soft =
-   MAX2((_g1->capacity() / 100) * (G1SteadyStateUsed - G1SteadyStateUsedDelta),
-        used_hard/2);
-  size_t used = _g1->used();
-
   double max_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
 
   size_t young_list_length = _g1->young_list_length();
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp	Tue Feb 23 23:13:23 2010 -0500
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp	Tue Feb 23 23:14:34 2010 -0500
@@ -100,13 +100,6 @@
   develop(intx, G1ConcZFMaxRegions, 1,                                      \
           "Stop zero-filling when # of zf'd regions reaches")               \
                                                                             \
-  product(intx, G1SteadyStateUsed, 90,                                      \
-          "If non-0, try to maintain 'used' at this pct (of max)")          \
-                                                                            \
-  product(intx, G1SteadyStateUsedDelta, 30,                                 \
-          "If G1SteadyStateUsed is non-0, then do pause this number of "    \
-          "of percentage points earlier if no marking is in progress.")     \
-                                                                            \
   develop(bool, G1SATBBarrierPrintNullPreVals, false,                       \
           "If true, count frac of ptr writes with null pre-vals.")          \
                                                                             \
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Tue Feb 23 23:13:23 2010 -0500
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Tue Feb 23 23:14:34 2010 -0500
@@ -1737,6 +1737,11 @@
     status = false;
   }
 
+  if (UseG1GC) {
+    status = status && verify_percentage(InitiatingHeapOccupancyPercent,
+                                         "InitiatingHeapOccupancyPercent");
+  }
+
   status = status && verify_interval(RefDiscoveryPolicy,
                                      ReferenceProcessor::DiscoveryPolicyMin,
                                      ReferenceProcessor::DiscoveryPolicyMax,
--- a/hotspot/src/share/vm/runtime/globals.hpp	Tue Feb 23 23:13:23 2010 -0500
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Feb 23 23:14:34 2010 -0500
@@ -1724,6 +1724,13 @@
           "Percentage CMS generation occupancy to start a CMS collection "  \
           "cycle. A negative value means that CMSTriggerRatio is used")     \
                                                                             \
+  product(uintx, InitiatingHeapOccupancyPercent, 45,                        \
+          "Percentage of the (entire) heap occupancy to start a "           \
+          "concurrent GC cycle. It us used by GCs that trigger a "          \
+          "concurrent GC cycle based on the occupancy of the entire heap, " \
+          "not just one of the generations (e.g., G1). A value of 0 "       \
+          "denotes 'do constant GC cycles'.")                               \
+                                                                            \
   product(intx, CMSInitiatingPermOccupancyFraction, -1,                     \
           "Percentage CMS perm generation occupancy to start a "            \
           "CMScollection cycle. A negative value means that "               \