diff src/share/vm/runtime/arguments.cpp @ 1356:56507bcd639e

6937160: G1: should observe GCTimeRatio Summary: Remove the G1GCPercent parameter, that specifies the desired GC overhead percentage in G1, and observe the GCTimeRatio parameter instead. Reviewed-by: jmasa, johnc
author tonyp
date Tue, 30 Mar 2010 15:36:55 -0400
parents cc98cc548f51
children 9e5e83ca2259 2338d41fbd81
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp	Thu Apr 01 20:48:50 2010 -0400
+++ b/src/share/vm/runtime/arguments.cpp	Tue Mar 30 15:36:55 2010 -0400
@@ -1353,6 +1353,16 @@
       MarkStackSize / K, MarkStackSizeMax / K);
     tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
   }
+
+  if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
+    // In G1, we want the default GC overhead goal to be higher than
+    // say in PS. So we set it here to 10%. Otherwise the heap might
+    // be expanded more aggressively than we would like it to. In
+    // fact, even 10% seems to not be high enough in some cases
+    // (especially small GC stress tests that the main thing they do
+    // is allocation). We might consider increase it further.
+    FLAG_SET_DEFAULT(GCTimeRatio, 9);
+  }
 }
 
 void Arguments::set_heap_size() {