RFR: 8301992: Embed SymbolTable CHT node [v4]

Ioi Lam iklam at openjdk.org
Thu Feb 16 18:56:30 UTC 2023


On Thu, 16 Feb 2023 16:56:56 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> Please review this patch for embedding the Symbol inside a ConcurrentHashTable Node instead of having a pointer to a Symbol. This eliminates malloc/free for each Symbol.
>> 
>> This patch is co-authored by @robehn.
>> 
>> Passed tiers 1 - 4 testing.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add Afree() for permanent symbols

src/hotspot/share/classfile/symbolTable.cpp line 168:

> 166:       if (!SymbolTable::arena()->Afree(memory, alloc_size)) {
> 167:         log_trace_symboltable_helper(&value, "Leaked permanent symbol");
> 168:       }

We should avoid freeing if DumpSharedSpaces is true, so that the code is symmetrical with allocate_node_impl(). Maybe this:


#if INCLUDE_CDS
  if (DumpSharedSpaces) {
    // no deallocation is needed
  } else
#endif
  if (value.refcount() != PERM_REFCOUNT) {

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

PR: https://git.openjdk.org/jdk/pull/12562


More information about the hotspot-dev mailing list