RFR: 8371990: Remove two second delayed OOME after GC shutdown [v3]
Stefan Karlsson
stefank at openjdk.org
Tue Nov 18 12:46:30 UTC 2025
On Tue, 18 Nov 2025 12:17:20 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> src/hotspot/share/gc/shared/gcVMOperations.cpp line 101:
>>
>>> 99: while (true) {
>>> 100: Heap_lock->wait();
>>> 101: }
>>
>> The intention here is to block all java-threads indefinitely, and those threads don't need to wait for any signals. I wonder if using a local always-zero semaphore might convey the intention more explicitly.
>
> It also has the side-effect that it releases the Heap_lock and moves the thread into the blocked state. If we don't release the lock then we will not be able to complete the shutdown sequence, which acquires the Heap_lock before the exit VM operation (or shutting down the VM thread).
I've pushed a comment stating the above. Maybe that helps explaining why Heap_lock->wait() is called.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28349#discussion_r2538043494
More information about the hotspot-gc-dev
mailing list