RFR: 8308745: ObjArrayKlass::allocate_objArray_klass may call into java while holding a lock
Coleen Phillimore
coleenp at openjdk.org
Tue Feb 6 13:29:01 UTC 2024
On Thu, 1 Feb 2024 05:22:24 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> This change uses a claim token to allocate multi dimensional arrays rather than holding MultiArray_lock around metaspace allocation. We can't hold a mutex around metaspace allocation because it can create an OOM object and it can also call into JVMTI for a resource exhausted event. Also, we were creating mirrors and more metadata arrays while holding this lock. See the bug for more details and other ideas considered and rejected.
>>
>> Tested with tier1-7.
>
> ~~Can't you just use a Monitor to implement the claim token, rather than this lock-free approach? (Similar to how class initialization is handled.)~~
>
> Sorry lost the forest in the trees.
I'm going to do a bit of rework as discussed with @dholmes-ora .
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17660#issuecomment-1929599218
More information about the serviceability-dev
mailing list