RFR: 8252049: Native memory leak in ciMethodData ctor
Vladimir Ivanov
vlivanov at openjdk.java.net
Mon Nov 30 13:59:03 UTC 2020
On Mon, 30 Nov 2020 13:41:23 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/oops/methodData.cpp line 1208:
>>
>>> 1206: MethodData::MethodData(ciMethodData& data)
>>> 1207: : _extra_data_lock(Mutex::leaf, "unused") {
>>> 1208: _extra_data_lock.~Mutex(); // release allocated resources before zeroing
>>
>> So if _extra_data_lock was a pointer to Mutex, then this statement would be simply "delete _extra_data_lock;" instead, but we'd still have this copy constructor, right?
>
> Why isn't this a regular copy constructor taking MethodData, and pass this._orig instead and leave the zeroing in the caller? I don't like that oops/methodData knows about ciMethodData.
If `_extra_data_lock` were a pointer, then `MethodData::MethodData` would just `_extra_data_lock(NULL)`.
Regarding where to put zeroing, I'm fine doing it either way.
Just want to give a try the idea David and Kim proposed with separating the lock from MDO (w/ superclass trick).
-------------
PR: https://git.openjdk.java.net/jdk/pull/1478
More information about the hotspot-runtime-dev
mailing list