8156028: G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value

Tue, 26 Nov 2019 15:23:15 +0800

author
sjohanss
date
Tue, 26 Nov 2019 15:23:15 +0800
changeset 9796
65749db89e61
parent 9789
e55d4d896e30
child 9797
8c0733543544

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

src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp file | annotate | diff | comparison | revisions
src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Fri Jul 10 11:31:49 2015 -0700
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp	Tue Nov 26 15:23:15 2019 +0800
     1.3 @@ -376,7 +376,7 @@
     1.4                               MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
     1.5                                    1U);
     1.6        _sizer_kind = SizerMaxAndNewSize;
     1.7 -      _adaptive_size = _min_desired_young_length == _max_desired_young_length;
     1.8 +      _adaptive_size = _min_desired_young_length != _max_desired_young_length;
     1.9      } else {
    1.10        _sizer_kind = SizerNewSizeOnly;
    1.11      }
     2.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Fri Jul 10 11:31:49 2015 -0700
     2.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp	Tue Nov 26 15:23:15 2019 +0800
     2.3 @@ -133,7 +133,11 @@
     2.4    SizerKind _sizer_kind;
     2.5    uint _min_desired_young_length;
     2.6    uint _max_desired_young_length;
     2.7 +
     2.8 +  // False when using a fixed young generation size due to command-line options,
     2.9 +  // true otherwise.
    2.10    bool _adaptive_size;
    2.11 +
    2.12    uint calculate_default_min_length(uint new_number_of_heap_regions);
    2.13    uint calculate_default_max_length(uint new_number_of_heap_regions);
    2.14  

mercurial