changeset 9081:65749db89e61

8156028: G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value Reviewed-by: jmasa, sangheki, drwhite, phh Contributed-by: maoliang.ml@alibaba-inc.com
author sjohanss
date Tue, 26 Nov 2019 15:23:15 +0800
parents e55d4d896e30
children 8c0733543544
files src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Jul 10 11:31:49 2015 -0700
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Nov 26 15:23:15 2019 +0800
@@ -376,7 +376,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_implementation/g1/g1CollectorPolicy.hpp	Fri Jul 10 11:31:49 2015 -0700
+++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Tue Nov 26 15:23:15 2019 +0800
@@ -133,7 +133,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);