RFR: JDK-8298084: Memory leak in Method::build_profiling_method_data [v6]

David Holmes dholmes at openjdk.org
Fri Dec 9 00:24:03 UTC 2022


On Thu, 8 Dec 2022 23:57:46 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/oops/method.cpp line 148:
>> 
>>> 146: #endif
>>> 147:     // Destroy MethodData
>>> 148:     method_data()->~MethodData();
>> 
>> You still need this here.  This is for the class unloading path.
>
> I agree this needs to remain else we are removing other destructor calls, not just adding back the one currently missing. But it raises the question for me as to why we have two distinct code paths to clean up the MethodData: one from `Method::release_C_heap_structures` and the other from `Method::deallocate_contents`? Aren't there code paths where both of those would be executed and we would then call the destructor twice?

I just saw the other comments point to the comment in JDK-8298346 so no need to respond to this.

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

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


More information about the hotspot-dev mailing list