diff --git a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index c4463f50fcc12a0bae7482ab2cdee03f7b8abf0f..b25ab59f2725437ccc1e7a25dacbfa10a6d52863 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 96e4dc63dd27688e4b5477ee6538aab8f2294221..d15dee26c5d02cb2a4cd32099bdea3187ace9aae 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);