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

Justin King jcking at openjdk.org
Wed Dec 7 07:44:50 UTC 2022


On Wed, 7 Dec 2022 00:44:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Also see:
> 
> https://mail.openjdk.org/pipermail/hotspot-dev/2019-October/039783.html
> 
> The use of the Mutex* causes a performance issue.

@dholmes-ora Should we just have `MetadataFactory::free_metadata` call the destructor for `T` right after `deallocate_contents` and immediately before deallocating? The compiler will be smart enough to omit the call for types that are trivially destructible. That would also solve this bug, preserve any performance, and ensure it cannot happen again easily. It is fairly easy to forget to call `release_c_heap_structures`.

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

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


More information about the hotspot-dev mailing list