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

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


On Thu, 8 Dec 2022 19:20:04 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Justin King has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add comment to metaprogramming usage
>>   
>>   Signed-off-by: Justin King <jcking at google.com>
>
> 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?

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

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


More information about the hotspot-dev mailing list