changeset 11285:e6cbd87926cb

8156028: G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value Reviewed-by: jmasa, sangheki, drwhite
author sjohanss
date Tue, 24 May 2016 10:05:03 +0200
parents 18194796107b
children 3c3f82513ffc 4676adf31b08
files src/share/vm/gc/g1/g1YoungGenSizer.cpp src/share/vm/gc/g1/g1YoungGenSizer.hpp
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/g1/g1YoungGenSizer.cpp	Tue May 24 09:07:22 2016 +0200
+++ b/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/src/share/vm/gc/g1/g1YoungGenSizer.hpp	Tue May 24 09:07:22 2016 +0200
+++ b/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);