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

Coleen Phillimore coleenp at openjdk.org
Thu Dec 8 20:31:05 UTC 2022


On Thu, 8 Dec 2022 08:19:26 GMT, Justin King <jcking at openjdk.org> wrote:

>> Resolve memory leak related to `MethodData::_extra_data_lock` in `Method::build_profiling_method_data` by calling `MethodData::~MethodData()`.
>
> 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>

I can't find why we thought it was more performant to embed the mutex in MethodData.

> Though it requires making Metadata hierarchy have virtual destructors to work as expected. Which should be fine, as it already has virtual functions.

Not everything that calls free_metadata is a Metadata object.  Some are MetaspaceObj and don't have virtual pointers.

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

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


More information about the hotspot-dev mailing list