[jdk20] RFR: 8298084: Memory leak in Method::build_profiling_method_data [v3]

David Holmes dholmes at openjdk.org
Tue Dec 13 01:19:35 UTC 2022


On Mon, 12 Dec 2022 17:51:25 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This change fixes the MethodData leak by calling the destructor in both the release_C_heap_structures conditionally and by calling the MethodData destructor in the MetadataFactory::free_metadata method.
>> Thanks to @jcking for working on the patch and discussion.
>> Tested with tier1-4.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Even more metaprogramming improvements

Thanks Coleen. A couple of further nits on comments but otherwise this seems okay.

src/hotspot/share/oops/instanceKlass.cpp line 600:

> 598:   // Can't release the constant pool here because the constant pool can be
> 599:   // deallocated separately from the InstanceKlass for default methods and
> 600:   // redefine classes.

Does this comment make sense when the parameter doesn't actually control release of the CP?

src/hotspot/share/oops/instanceKlass.cpp line 2667:

> 2665: }
> 2666: 
> 2667: // Called also by InstanceKlass::deallocate_contents, with false for release_constant_pool.

Comment needs updating.

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk20/pull/13


More information about the hotspot-dev mailing list