8156028: G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value
Reviewed-by: jmasa, sangheki, drwhite
--- a/hotspot/src/share/vm/gc/g1/g1YoungGenSizer.cpp Tue May 24 09:07:22 2016 +0200
+++ b/hotspot/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/hotspot/src/share/vm/gc/g1/g1YoungGenSizer.hpp Tue May 24 09:07:22 2016 +0200
+++ b/hotspot/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);