Integrated: 8292680: Convert Dictionary to ConcurrentHashTable

Coleen Phillimore coleenp at openjdk.org
Thu Aug 25 19:07:50 UTC 2022


On Tue, 16 Aug 2022 02:35:02 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This change converts the dictionaries per ClassLoaderData from Old Hashtable to ConcurrentHashTables.  The CHT has a few extra fields (locks and such) but the Old Hashtable had TableRateStatistics so footprint is similar.  The Dictionaries require lock-free lookups because we lookup classes that we've already loaded whenever their names appear in the source code, which is pretty much all the time.  The Dictionaries retain the SystemDictionary_lock for writing.  Locking for adding entries gates other things like compiler dependencies and placeholder operations and loader constraint checking.  The one thing that we can do with the CHT is do a resize without going to a safepoint, so this can resize dictionaries during adding.  There's a test for this.
> 
> Entries in the dictionaries are never individually deleted.  When the class loader for the ClassLoaderData holding the dictionary is unloaded, the entire dictionary is deleted.  Note dictionary is an old name for hashtable of loaded classes.  We're keeping that name.
> I added a test for printing dictionary statistics.
> 
> This has been tested with tier1-7, with tier1 on all Oracle platforms.  I've also performance tested this with our internal performance test suite with slight improvement but not statistically significant.

This pull request has now been integrated.

Changeset: 4f50316a
Author:    Coleen Phillimore <coleenp at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/4f50316a1a985cd06af7eed158d7e1917b86d159
Stats:     620 lines in 30 files changed: 264 ins; 184 del; 172 mod

8292680: Convert Dictionary to ConcurrentHashTable

Reviewed-by: rehn, hseigel

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

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


More information about the hotspot-dev mailing list