RFR: 8366865: Allocation GC Pauses Triggered after JVM has started shutdown [v4]

Jonas Norlinder duke at openjdk.org
Tue Sep 16 11:09:28 UTC 2025


On Tue, 16 Sep 2025 09:26:19 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 incrementally with one additional commit since the last revision:
> 
>   Revert

Changes requested by JonasNorlinder at github.com (no known OpenJDK username).

src/hotspot/share/memory/universe.cpp line 1347:

> 1345: 
> 1346: void Universe::before_exit() {
> 1347:   log_cpu_time();

Why did you move `log_cpu_time()`? During the review of CPUTimeUsage refactor (https://github.com/openjdk/jdk/pull/26621) we discussed this choice. Given that it still includes more than just GC I think it should stay in `Universe`. Also the PR title does not reflect that it would include a refactor of CPUTimeUsage.

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

PR Review: https://git.openjdk.org/jdk/pull/27190#pullrequestreview-3229290160
PR Review Comment: https://git.openjdk.org/jdk/pull/27190#discussion_r2352019449


More information about the hotspot-dev mailing list