RFR: 8366865: Allocation GC Pauses Triggered after JVM has started shutdown [v6]
David Holmes
dholmes at openjdk.org
Thu Sep 18 05:22:39 UTC 2025
On Wed, 17 Sep 2025 14:59:05 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:
>> Please review this patch to skip VM_GC_Collect_Operations if initiated after the VM shutdown process has begun. We add a _is_shutting_down flag to CollectedHeap, which is set while holding the Heap_lock. This ensures mutual exclusion with VM_GC_Collect_Operations, which also require the Heap_lock.
>>
>> Skipping VM_GC_Collect_Operation would otherwise cause allocation requests to fail (resulting in OutOfMemoryError) if requesting daemon threads were allowed to continue, we instead block these threads on a monitor. They remain stalled until they are terminated as part of the VM shutdown sequence.
>>
>> Testing: Tier 1-7
>
> Ivan Walulya has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:
>
> - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
> - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
> - Revert
> - Thomas Review
> - return on timeout
> - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
> - timed wait
> - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
> - space
> - remove debug logs
> - ... and 3 more: https://git.openjdk.org/jdk/compare/d7eeacf2...ab94789c
As this doesn't seem to perturb the general shutdown process I have no further comment and will leave it to GC folk to approve.
Though I still wonder if this aspect of shutdown should be part of "Heap" (or Universe) rather than G1 specific.
-------------
PR Review: https://git.openjdk.org/jdk/pull/27190#pullrequestreview-3237321918
More information about the hotspot-dev
mailing list