RFR: 8267752: KVHashtable doesn't deallocate entries
Coleen Phillimore
coleenp at openjdk.java.net
Wed Jun 16 12:30:33 UTC 2021
On Wed, 16 Jun 2021 04:24:04 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> I wanted to do that (and even had a version that did), but unfortunately for this code, adding a destructor to SrcObjRef destroys the ref pointer in this scope, so we'd need to have a copy constructor etc to keep the pointer alive.
>>
>> https://github.com/openjdk/jdk/blob/e0f6f70d3f9e748d2bc53f371beca487e9343d4a/src/hotspot/share/cds/archiveBuilder.cpp#L464
>>
>> So I thought we should wait until we replace this table to make it better. I was going to add a comment here.
>
> Sounds good. The current code is a bit clumsy but there's no memory leak anymore. We should eventually move all functionalities of KVHashTable into ResourceHashtable so we don't have 2 different partially working hashtable types!
Yes, I agree. This src_obj_table will still need some surgery, since the replacement table should call destructors on all the elements so maybe the table shouldn't contain a copy of SourceObjectInfo.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4501
More information about the hotspot-dev
mailing list