diff src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @ 1991:016a3628c885

6994056: G1: when GC locker is active, extend the Eden instead of allocating into the old gen Summary: Allow the eden to the expanded up to a point when the GC locker is active. Reviewed-by: jwilhelm, johnc, ysr, jcoomes
author tonyp
date Tue, 07 Dec 2010 16:47:42 -0500
parents 631f79e71e90
children 5c0b591e1074
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Thu Dec 02 13:20:39 2010 -0500
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Tue Dec 07 16:47:42 2010 -0500
@@ -196,6 +196,10 @@
   size_t _young_list_target_length;
   size_t _young_list_fixed_length;
 
+  // The max number of regions we can extend the eden by while the GC
+  // locker is active. This should be >= _young_list_target_length;
+  size_t _young_list_max_length;
+
   size_t _young_cset_length;
   bool   _last_young_gc_full;
 
@@ -1113,13 +1117,22 @@
 
   bool is_young_list_full() {
     size_t young_list_length = _g1->young_list()->length();
-    size_t young_list_max_length = _young_list_target_length;
+    size_t young_list_target_length = _young_list_target_length;
+    if (G1FixedEdenSize) {
+      young_list_target_length -= _max_survivor_regions;
+    }
+    return young_list_length >= young_list_target_length;
+  }
+
+  bool can_expand_young_list() {
+    size_t young_list_length = _g1->young_list()->length();
+    size_t young_list_max_length = _young_list_max_length;
     if (G1FixedEdenSize) {
       young_list_max_length -= _max_survivor_regions;
     }
+    return young_list_length < young_list_max_length;
+  }
 
-    return young_list_length >= young_list_max_length;
-  }
   void update_region_num(bool young);
 
   bool in_young_gc_mode() {
@@ -1231,6 +1244,8 @@
     _survivors_age_table.merge_par(age_table);
   }
 
+  void calculate_max_gc_locker_expansion();
+
   // Calculates survivor space parameters.
   void calculate_survivors_policy();