RFR: 8338977: Parallel: Improve heap resizing heuristics [v2]
Guoxiong Li
gli at openjdk.org
Mon May 19 11:08:59 UTC 2025
On Mon, 19 May 2025 05:20:36 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp line 232:
>>
>>> 230: // Major times are too long, so we want less promotion.
>>> 231: incr_tenuring_threshold = true;
>>> 232: }
>>
>> You keep the condition `minor_cost > major_cost * _threshold_tolerance_percent` of the previous code. But it will be strange when we only read the new code (in the future). What about removing the condition `minor_cost > major_cost * _threshold_tolerance_percent` and moving the comment `we prefer young-gc over full-gc` to another place?
>
> I keep it this way because I find the structure to be more symmetric, but I don't have a strong opinion on this. If you prefer, I can remove the empty if-branch. (The resulting asm should be identical.)
I prefer removing it; waiting for opinions by other reviewers.
>> src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp line 254:
>>
>>> 252: // survived is an underestimate
>>> 253: _survived_bytes.add(survived + promoted);
>>> 254: }
>>
>> The parameter `is_survivor_overflow` seems unnecessary. When `is_survivor_overflow` is `false`, the `promoted` is `0`. What about using `_survived_bytes.add(survived + promoted)` only and removing parameter `is_survivor_overflow` (and the related conditional code).
>
>> When is_survivor_overflow is false, the promoted is 0
>
> That's not true; objs that live long enough will be promoted as well, even when the survivor-space has plenty of free-space.
Ohh, you are right, I forgot it at that time.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25000#discussion_r2095457633
PR Review Comment: https://git.openjdk.org/jdk/pull/25000#discussion_r2095457808
More information about the hotspot-dev
mailing list