RFR (S) 8232112: MDO extra_data_lock leaks during class unloading
coleen.phillimore at oracle.com
coleen.phillimore at oracle.com
Thu Oct 17 02:18:02 UTC 2019
On 10/16/19 8:25 PM, David Holmes wrote:
> Hi Coleen,
>
> On 16/10/2019 11:48 pm, coleen.phillimore at oracle.com wrote:
>> Summary: call the MDO destructor during class unloading.
>>
>> Also moved the other C heap deallocation from method_data to
>> release_C_heap_structures. Methods won't have method_data unless
>> they're deallocated from the InstanceKlass. The other paths to
>> deallocate_contents are before the method is called.
>
> I'm not understanding why delete is not used to run the destructor and
> free the memory. Is this memory that is being specially managed?
The _extra_data_lock Mutex is embedded in the MethodData, and MethodData
is allocated in Metaspace which is deleted en-masse when a class is
unloaded. It also may be deleted during redefinition, when the
InstanceKlass is deleted (all old methods are not running).
I actually tested a version where I changed _extra_data_lock to a Mutex*
and used new/delete for it. This caused a slight degredation in one of
our performance benchmarks, so I changed it to call the destructor
explicitly (with Kim's help with syntax).
Thanks,
Coleen
>
> Thanks,
> David
>
>> Tested with tier1 all Oracle platforms, and tier2-6 on linux-x64.
>>
>> open webrev at
>> http://cr.openjdk.java.net/~coleenp/2019/8232112.01/webrev
>> bug link https://bugs.openjdk.java.net/browse/JDK-8232112
>>
>> Thanks,
>> Coleen
>>
>>
More information about the hotspot-dev
mailing list