RFR: 8368740: Serial: Swap eden and survivor spaces position in young generation [v2]

Albert Mingkun Yang ayang at openjdk.org
Fri Sep 26 13:27:35 UTC 2025


On Fri, 26 Sep 2025 09:12:37 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:

>> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/gc/serial/defNewGeneration.cpp line 283:
> 
>> 281:   }
>> 282:   size_t eden_size = size - (2 * survivor_size);
>> 283:   assert(eden_size > 0 && survivor_size <= eden_size, "just checking");
> 
> Is it guaranteed that `size > 2 * survivor_size`?

I overlooked that. Revised `calculate_desired_young_gen_bytes` so that we can have such invariant here.

> src/hotspot/share/gc/serial/defNewGeneration.cpp line 426:
> 
>> 424:       return;
>> 425:     }
>> 426:   } else {
> 
> How about `else if (current_young_gen_size_bytes > desired_young_gen_size_bytes)` here? `VirtualSpace::shrink_by(size_t)` seems to do some work even when `delta_bytes = 0`.

The zero-case is handled a few lines above by `if (current_young_gen_size_bytes == desired_young_gen_size_bytes)`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27513#discussion_r2382420566
PR Review Comment: https://git.openjdk.org/jdk/pull/27513#discussion_r2381640393


More information about the hotspot-gc-dev mailing list