RFR: JDK-8298084: Memory leak in Method::build_profiling_method_data

David Holmes dholmes at openjdk.org
Wed Dec 7 20:58:59 UTC 2022


On Tue, 6 Dec 2022 06:13:23 GMT, Justin King <jcking at openjdk.org> wrote:

> Resolve memory leak related to `MethodData::_extra_data_lock` in `Method::build_profiling_method_data` by defining `MethodData::release_C_heap_structures` and calling it where appropriate before deallocating `MethodData`.

Perhaps an oversimplification, but we are missing a destructor call so the solution seems to be to put that destructor call back for that missing case. If we can't always call the destructor then we need to be selective about it.

Replacing the destructor with release_C_heap_structures and changing from embedded mutex to independent mutex, seems a lot of changes for one missing destructor.

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

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


More information about the hotspot-dev mailing list