RFR: 8256302: releasing oopStorage when deflating allows for faster deleting [v5]

Coleen Phillimore coleenp at openjdk.org
Tue Jun 6 20:16:08 UTC 2023


On Tue, 6 Jun 2023 20:07:39 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> src/hotspot/share/runtime/objectMonitor.cpp line 282:
>> 
>>> 280:     // Release object's oop storage if it hasn't already been done.
>>> 281:     release_object();
>>> 282:   }
>> 
>> In what case, would the object's oop storage not already been released?  Is the destructor called here because of GC, where the object has been collected?
>
> There are a couple of places where thread-A allocates an ObjectMonitor for inflation,
> but thread-A loses the race to install an ObjectMonitor to thread-B so the ObjectMonitor
> allocated by thread-A has to be deleted/freed.
> 
> In an earlier version of the patch I had `release_object()` calls in both of those locations
> and a couple of the reviewers thought that was "clunky".

Ok, thanks for the clarification. I agree with having it here in the destructor for that case.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/11296#discussion_r1220268621


More information about the hotspot-runtime-dev mailing list