diff options
author | sjohanss <unknown> | 2019-11-26 15:23:15 +0800 |
---|---|---|
committer | bell-sw <liberica@bell-sw.com> | 2020-01-19 09:12:37 +0300 |
commit | 0f38157f26b925f093985c5c67de3219d8446fb5 (patch) | |
tree | 148fa2712c687f24f3702295e27633d75e35cea4 | |
parent | 6b1aaffc916fab70adfba09ec0243fd30979fce0 (diff) | |
download | jdk8u_hotspot-0f38157f26b925f093985c5c67de3219d8446fb5.tar.gz |
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
-rw-r--r-- | src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp | 2 | ||||
-rw-r--r-- | src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index c4463f50f..b25ab59f2 100644 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -376,7 +376,7 @@ G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults), _adaptive_size( 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; } diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp index 96e4dc63d..d15dee26c 100644 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @@ -133,7 +133,11 @@ private: 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); |