RFR: 8377561: Parallel: Large allocations cause Full GC storm without heap expansion

Joel Sikström jsikstro at openjdk.org
Mon Feb 16 12:05:35 UTC 2026


On Wed, 11 Feb 2026 13:57:02 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> `ParallelScavengeHeap::should_alloc_in_eden` uses the current eden-capacity to decide whether an allocation should be in eden and the same criteria is also used to decide whether we should run young/full gc to satisfy a failed allocations. When the young-gen/eden-size is relatively small (due to initial heap being small or heap has shrunk), the use of the current eden-capacity can cause full-gc, instead of young-gc, to run, as shown in the attached bm in this bug (https://bugs.openjdk.org/browse/JDK-8377561).
> 
> Use "max" eden capacity as the calculation basis so that the threshold is more resilient to heap resizing.
> 
> The attached bm runs thousands of full-gc before the fix but zero full-gc after the fix.
> 
> Test: tier1-5

Looks good.

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

Marked as reviewed by jsikstro (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29673#pullrequestreview-3808248012


More information about the hotspot-gc-dev mailing list