RFR: 8301992: Embed SymbolTable CHT node [v3]
Coleen Phillimore
coleenp at openjdk.org
Thu Feb 16 00:28:45 UTC 2023
On Wed, 15 Feb 2023 23:48:12 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/classfile/symbolTable.cpp line 161:
>>
>>> 159: FreeHeap(memory);
>>> 160: SymbolTable::item_removed();
>>> 161: }
>>
>> We don’t call afree() anymore if the symbol is permanent. . Is this intentional?
>>
>> Actually the old code has a bug. A non permanent symbol allocated from the c heap can overflow the refcount and become permanent. If it needs to be freed, we cannot call afree.
>>
>> Anyway, how is it possible for a permanent symbol to be freed here? Maybe this should be changed to an assert?
>
> Yes, it seemed dubious if we ever freed the entry from the symbol arena, so I think it's ok. It would only free the Symbol if it was the last one allocated and there was a race when inserting the same permanent symbol in the table.
>
> You're right there would be a bug if we tried to free a CHeap allocated symbol from the arena if the refcount became permanent. I'm not sure what would happen in that case.
Oh but if it overflows the refcount to become permanent, the permanence is sticky. We won't free it, so it's not a bug.
-------------
PR: https://git.openjdk.org/jdk/pull/12562
More information about the hotspot-dev
mailing list