RFR: JDK-8298084: Memory leak in Method::build_profiling_method_data
Justin King
jcking at openjdk.org
Wed Dec 7 07:49:01 UTC 2022
On Wed, 7 Dec 2022 07:41:08 GMT, Justin King <jcking 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`.
This would also assume `MetadataFactory::free_metadata` is always called with the most base class, since I believe Metadata objects don't have virtual destructors.
-------------
PR: https://git.openjdk.org/jdk/pull/11526
More information about the hotspot-dev
mailing list