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

Guoxiong Li gli at openjdk.org
Tue Oct 14 07:43:03 UTC 2025


On Mon, 29 Sep 2025 07:34:41 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/serial/defNewGeneration.cpp line 478:
>> 
>>> 476: 
>>> 477:   // Keep from/to and expand eden.
>>> 478:   expand_eden_by(_virtual_space.uncommitted_size());
>> 
>> Just expanding eden space may go against the option `SurvivorRatio`.
>
> Indeed; this happens when young-gen is still not empty after full-gc -- this is kind of an extreme scenario. Given there can be live objs inside survivor/eden, the only safe way to expand is to expand eden, as it's the final space in the new layout.
> 
> Consequently, `DefNewGeneration::max_capacity` is updated to ensure `capacity <= max_capacity`.

> It seems not obey the eden/survivor ratio rule.

What about adding a comment (may be tagged as `TODO` or `FIXME`) in the code or filing an issue to state the potential problem?

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

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


More information about the hotspot-gc-dev mailing list