-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b122
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8235345 | openjdk8u242 | Stefan Johansson | P4 | Resolved | Fixed | b05 |
When creating the G1YoungGenSizer some flags are considered. But the code below looks wrong:
if (FLAG_IS_CMDLINE(NewSize)) {
_min_desired_young_length = MAX2((uint) (NewSize / HeapRegion::GrainBytes),
1U);
if (FLAG_IS_CMDLINE(MaxNewSize)) {
_max_desired_young_length =
MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
1U);
_sizer_kind = SizerMaxAndNewSize;
_adaptive_size = _min_desired_young_length == _max_desired_young_length;
}
If both values are set to the same value, the _adaptive_size comparison will return true. But if they are the same the size should never change.
I'm not sure if it is as easy as just changing the comparison, since the _adaptive_size is used for some different things and changing this might have unexpected side effects.
if (FLAG_IS_CMDLINE(NewSize)) {
_min_desired_young_length = MAX2((uint) (NewSize / HeapRegion::GrainBytes),
1U);
if (FLAG_IS_CMDLINE(MaxNewSize)) {
_max_desired_young_length =
MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
1U);
_sizer_kind = SizerMaxAndNewSize;
_adaptive_size = _min_desired_young_length == _max_desired_young_length;
}
If both values are set to the same value, the _adaptive_size comparison will return true. But if they are the same the size should never change.
I'm not sure if it is as easy as just changing the comparison, since the _adaptive_size is used for some different things and changing this might have unexpected side effects.
- backported by
-
JDK-8235345 G1YoungGenSizer _adaptive_size not correct when setting NewSize and MaxNewSize to the same value
-
- Resolved
-