RFR: JDK-8298084: Memory leak in Method::build_profiling_method_data [v2]
Justin King
jcking at openjdk.org
Thu Dec 8 05:58:10 UTC 2022
On Thu, 8 Dec 2022 05:45:53 GMT, David Holmes <dholmes at openjdk.org> wrote:
> Sorry, the destructor has to, of course, be used in a safe manner - I didn't mean to imply otherwise. Given what `free_metadata` does with the `md` we can't call the destructor before calling it. Perhaps we can add a default parameter `bool invoke_destructor = false` to `free_metadata`, to then call the destructor at the right point (which would be before or after `md->deallocate_contents`).
Yeah, that is what I was thinking. https://github.com/jcking/jdk/commit/5f1aad3723b56566428df7b4780ef2d5ca87f29d is an example of this approach. Though it requires making `Metadata` hierarchy have virtual destructors to work as expected. Which should be fine, as it already has virtual functions. Happy to move that commit here if that would be the preferred approach.
-------------
PR: https://git.openjdk.org/jdk/pull/11526
More information about the hotspot-dev
mailing list