RFR: 8371019: G1: Support heap expansion during startup

Stefan Johansson sjohanss at openjdk.org
Mon Nov 10 10:32:37 UTC 2025


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

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

Commit messages:
 - Thomas feedback
 - 8371019: G1: Support heap expansion during startup

Changes: https://git.openjdk.org/jdk/pull/28213/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28213&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371019
  Stats: 24 lines in 3 files changed: 17 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/28213.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28213/head:pull/28213

PR: https://git.openjdk.org/jdk/pull/28213


More information about the hotspot-gc-dev mailing list