RFR: 8371990: Remove two second delayed OOME after GC shutdown [v3]
Stefan Karlsson
stefank at openjdk.org
Tue Nov 18 13:54:15 UTC 2025
On Tue, 18 Nov 2025 12:57:13 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> I've pushed a comment stating the above. Maybe that helps explaining why Heap_lock->wait() is called.
>
>> It also has the side-effect that it releases the Heap_lock ...
>
> Yes. My msg was probably unclear; I meant to suggest using sth like:
>
>
> Heap_lock->unlock();
> {
> Semaphore always_blocked_sema{0};
> always_blocked_sema.wait(); // never return
> }
Yeah, I got that. I just don't think that's much clearer. (BTW, you need to use `Semaphore::wait_with_safepoint_check` because `Semaphore::wait` doesn't transition to the blocked state. Or use ThreadBlockInVM.)
Maybe if we had some API that could change the code to be:
Heap_lock->unlock();
block_forever();
But I don't think we have that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28349#discussion_r2538303025
More information about the hotspot-gc-dev
mailing list