RFR: 8256302: releasing oopStorage when deflating allows for faster deleting

Coleen Phillimore coleenp at openjdk.org
Tue Nov 29 17:28:31 UTC 2022


On Mon, 28 Nov 2022 22:54:05 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> We can only release if the current thread is in VM, since we to call the destructor from blocked we can't release there.
>> But we can have an assert that WH is null, i.e. `~OM() { assert(_object.is_null(), "Missed one"); }`.
>
> If JavaThread:
> ThreadBlockInVM tbivm(JavaThread::cast(current));
>   delete delete_list items;
> 
> Isn't the thread in the vm?
> 
> I wandered into this PR and am trying to understand why the release is moved out of the destructor also.

I see.  The OopStorage.release() requires that the thread can't be in thread_blocked and you want to have a safepoint check there.  Is the safepoint check for each item in the list because the OopStorage.release() might take a while?  In this code, you've just done a handshake.  Shouldn't that be sufficient?

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

PR: https://git.openjdk.org/jdk/pull/11296


More information about the hotspot-runtime-dev mailing list