8156028: G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value
authorsjohanss
Tue, 24 May 2016 10:05:03 +0200
changeset 38652 ba8be1a71dec
parent 38651 c86a9e9079fb
child 38655 88ad94c5ae32
child 38701 5f0770ab49d9
8156028: G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value Reviewed-by: jmasa, sangheki, drwhite
hotspot/src/share/vm/gc/g1/g1YoungGenSizer.cpp
hotspot/src/share/vm/gc/g1/g1YoungGenSizer.hpp
--- a/hotspot/src/share/vm/gc/g1/g1YoungGenSizer.cpp	Tue May 24 09:07:22 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1YoungGenSizer.cpp	Tue May 24 10:05:03 2016 +0200
@@ -56,7 +56,7 @@
                              MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
                                   1U);
       _sizer_kind = SizerMaxAndNewSize;
-      _adaptive_size = _min_desired_young_length == _max_desired_young_length;
+      _adaptive_size = _min_desired_young_length != _max_desired_young_length;
     } else {
       _sizer_kind = SizerNewSizeOnly;
     }
--- a/hotspot/src/share/vm/gc/g1/g1YoungGenSizer.hpp	Tue May 24 09:07:22 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1YoungGenSizer.hpp	Tue May 24 10:05:03 2016 +0200
@@ -75,7 +75,11 @@
   SizerKind _sizer_kind;
   uint _min_desired_young_length;
   uint _max_desired_young_length;
+
+  // False when using a fixed young generation size due to command-line options,
+  // true otherwise.
   bool _adaptive_size;
+
   uint calculate_default_min_length(uint new_number_of_heap_regions);
   uint calculate_default_max_length(uint new_number_of_heap_regions);