RFR: 8268078: ClassListParser::_interfaces should be freed

Coleen Phillimore coleenp at openjdk.java.net
Tue Jun 15 22:33:32 UTC 2021


On Tue, 15 Jun 2021 22:25:16 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> This patch frees the `_interfaces`, `_indy_items`, and `_id2klass_table` of `ClassListParser` in its destructor.
>> It also fixes the non-NULL check at line 88.
>> 
>> - [x] mach5 tiers 1, 2 tests
>
> src/hotspot/share/cds/classListParser.cpp line 94:
> 
>> 92:   delete _indy_items;
>> 93:   delete _interfaces;
>> 94:   cleanup_table();
> 
> I just realized that the `_id2klass_table` contains only `InstanceKlass*` values, so there's no need to clean up the values themselves (the InstanceKlass should keep on living after the table is deallocated).
> 
> It's the entries of `_id2klass_table` that need to be freed, but that should be done separately. See [JDK-8267752](https://bugs.openjdk.java.net/browse/JDK-8267752)
> 
> So I think the changes related to `_id2klass_table` in this PR are no longer needed. Sorry for pointing you to the wrong direction. The rest looks OK to me.

Yes, I have a PR for JDK-8267752.  The release_C_heap_structures shouldn't be called until the classes are either unloaded or deallocated.

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

PR: https://git.openjdk.java.net/jdk/pull/4498


More information about the hotspot-runtime-dev mailing list