8028093: Initial young size is smaller than minimum young size
authorjwilhelm
Mon, 11 Nov 2013 13:50:10 +0100
changeset 21567 938a7ca4d2aa
parent 21566 4463f810db82
child 21568 5f57686b1d84
8028093: Initial young size is smaller than minimum young size Summary: Remove min_gen1_size argument from adjust_gen0_sizes() Reviewed-by: tschatzl, brutisso
hotspot/src/share/vm/memory/collectorPolicy.cpp
hotspot/src/share/vm/memory/collectorPolicy.hpp
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Sun Nov 10 00:07:29 2013 +0100
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Mon Nov 11 13:50:10 2013 +0100
@@ -523,17 +523,15 @@
 // keeping it simple also seems a worthwhile goal.
 bool TwoGenerationCollectorPolicy::adjust_gen0_sizes(size_t* gen0_size_ptr,
                                                      size_t* gen1_size_ptr,
-                                                     const size_t heap_size,
-                                                     const size_t min_gen1_size) {
+                                                     const size_t heap_size) {
   bool result = false;
 
-  if ((*gen1_size_ptr + *gen0_size_ptr) > heap_size) {
+  if ((*gen0_size_ptr + *gen1_size_ptr) > heap_size) {
     uintx smallest_new_size = young_gen_size_lower_bound();
-    if ((heap_size < (*gen0_size_ptr + min_gen1_size)) &&
-        (heap_size >= min_gen1_size + smallest_new_size)) {
-      // Adjust gen0 down to accommodate min_gen1_size
-      *gen0_size_ptr = align_size_down_bounded(heap_size - min_gen1_size, _gen_alignment);
-      assert(*gen0_size_ptr > 0, "Min gen0 is too large");
+    if ((heap_size < (*gen0_size_ptr + _min_gen1_size)) &&
+        (heap_size >= _min_gen1_size + smallest_new_size)) {
+      // Adjust gen0 down to accommodate _min_gen1_size
+      *gen0_size_ptr = align_size_down_bounded(heap_size - _min_gen1_size, _gen_alignment);
       result = true;
     } else {
       *gen1_size_ptr = align_size_down_bounded(heap_size - *gen0_size_ptr, _gen_alignment);
@@ -594,8 +592,7 @@
     }
     // If there is an inconsistency between the OldSize and the minimum and/or
     // initial size of gen0, since OldSize was explicitly set, OldSize wins.
-    if (adjust_gen0_sizes(&_min_gen0_size, &_min_gen1_size,
-                          _min_heap_byte_size, _min_gen1_size)) {
+    if (adjust_gen0_sizes(&_min_gen0_size, &_min_gen1_size, _min_heap_byte_size)) {
       if (PrintGCDetails && Verbose) {
         gclog_or_tty->print_cr("2: Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
               SIZE_FORMAT "  Maximum gen0 " SIZE_FORMAT,
@@ -604,7 +601,7 @@
     }
     // Initial size
     if (adjust_gen0_sizes(&_initial_gen0_size, &_initial_gen1_size,
-                          _initial_heap_byte_size, _initial_gen1_size)) {
+                          _initial_heap_byte_size)) {
       if (PrintGCDetails && Verbose) {
         gclog_or_tty->print_cr("3: Minimum gen0 " SIZE_FORMAT "  Initial gen0 "
           SIZE_FORMAT "  Maximum gen0 " SIZE_FORMAT,
--- a/hotspot/src/share/vm/memory/collectorPolicy.hpp	Sun Nov 10 00:07:29 2013 +0100
+++ b/hotspot/src/share/vm/memory/collectorPolicy.hpp	Mon Nov 11 13:50:10 2013 +0100
@@ -336,9 +336,9 @@
     return CollectorPolicy::TwoGenerationCollectorPolicyKind;
   }
 
-  // Returns true is gen0 sizes were adjusted
+  // Returns true if gen0 sizes were adjusted
   bool adjust_gen0_sizes(size_t* gen0_size_ptr, size_t* gen1_size_ptr,
-                         const size_t heap_size, const size_t min_gen1_size);
+                         const size_t heap_size);
 };
 
 class MarkSweepPolicy : public TwoGenerationCollectorPolicy {