RFR: 8340824: C2: Memory for TypeInterfaces not reclaimed by hashcons() [v2]
Quan Anh Mai
qamai at openjdk.org
Fri Sep 27 18:54:36 UTC 2024
On Fri, 27 Sep 2024 18:28:37 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Roland Westrelin has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - type interfaces footprint
>> - Revert "fix"
>>
>> This reverts commit 3598dc08625269aa0a6ecff2a6903c4217b801ee.
>
> src/hotspot/share/opto/type.cpp line 3270:
>
>> 3268: }
>> 3269:
>> 3270: const TypeInterfaces* TypeInterfaces::make(const GrowableArray<ciInstanceKlass*>* interfaces) {
>
> I think you can make `_interface` a `ciInstanceKlass**` and do this:
>
> void* ptr = Type::operator new(sizeof(TypeInterfaces) + sizeof(ciInstanceKlass*) * interfaces->length())
>
> Then `delete ptr` should drop the whole thing.
A `GrowableArrayFromArray` would be mostly compatible with the interface of `GrowableArray`, too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21163#discussion_r1779023497
More information about the hotspot-compiler-dev
mailing list