Skip to content

Conversation

@reinrich
Copy link
Member

@reinrich reinrich commented Feb 2, 2026

This pr introduces a new experimental option G1HumAllocPercentUntilConcurrent that controls the G1 enhancement described below. With its default value 0 the enhancement is disabled.

A value >0 is interpreted as threshold for humongous allocations given as percentage of the maximum heap size. The threshold limits humongous allocations between mixed evacuation pauses. If reached the current mixed phase is aborted in favor of a new concurrent marking cycle.

Without this enhancement G1 would not initiate concurrent marking in a mixed phase. The problem with this behavior is that the heap can fill up with humongous allocations while G1 waits for the next mixed evacuation pause that will be scheduled only when eden is full. If the heap is full of humongous objects before then a full gc is necessary.

Testing

The reproducer from

8355972: G1: Exclusive humongous allocations trigger unnecessary Full GC

doesn't show full gcs if the enhancement is enabled with -XX:+UnlockExperimentalVMOptions -XX:G1HumAllocPercentUntilConcurrent=30

Full command:

java -Xmx1g -Xlog:gc* -XX:+UnlockExperimentalVMOptions -XX:G1HumAllocPercentUntilConcurrent=30 HumongousGc.java

The change includes a regression test similar to the reproducer.

A patch with G1HumAllocPercentUntilConcurrent=10 is part of our nightly testing since January 30.

fixes #2165

@SapMachine
Copy link
Member

Hello @reinrich, this pull request fulfills all formal requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants