RFR: 8371019: G1: Support heap expansion during startup

Thomas Schatzl tschatzl at openjdk.org
Mon Nov 10 13:40:10 UTC 2025


On Mon, 10 Nov 2025 09:32:32 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> Please review this change to allow G1 to expand the initial heap during startup
> 
> **Summary**
> Currently G1 shuts down during startup if we allocate more memory than what's available in the initial young generation. The reason is that we can't allow GCs during initialization. To allow G1 to work in situations requiring additional memory during initialization, this change enables G1 to expand the initial young generation size all the way up the maximum heap size. When initialization is complete mutator allocations will no longer expand the heap.
> 
> **Testing**
> * Mach 5 tier1-5
> * Manual testing requiring additional allocations during startup

Marked as reviewed by tschatzl (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/28213#pullrequestreview-3443301903


More information about the hotspot-gc-dev mailing list