RFR: 8371990: Remove two second delayed OOME after GC shutdown

Ivan Walulya iwalulya at openjdk.org
Mon Nov 17 20:13:04 UTC 2025


On Mon, 17 Nov 2025 19:49:06 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/gcVMOperations.hpp line 143:
>> 
>>> 141: 
>>> 142:   // Queried value of CollectedHeap::is_shutting_down while holding the Heap_lock.
>>> 143:   bool is_shutting_down() const { return _is_shutting_down; }
>> 
>> Maybe we assert on the "holding the Heap_lock" instead of having the comment.
>
> This function can (and will) be called without holding the `Heap_lock`. That's what the comment tried, but obviously failed, to say. :.
> 
> The point it tried to convey was that `VM_GC_Operation::_is_shutting_down` was initialized with the value read from `CollectedHeap::_is_shutting_down` while holding the `Heap_lock`. Subsequent code, that doesn't hold the `Heap_lock` could check `VM_GC_Operation::_is_shutting_down` to see if we skipped the GC operation because the JVM is shutting down.
> 
> I'll see if I can make the comment more clear.

yeah, after the explanation, now comment makes sense. I didn't understand it on first pass.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28349#discussion_r2535376447


More information about the hotspot-gc-dev mailing list