RFR: 8191786: Thread-SMR hash table size should be dynamic [v2]

Coleen Phillimore coleenp at openjdk.java.net
Tue May 25 21:35:34 UTC 2021


On Tue, 25 May 2021 21:19:58 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/runtime/threadSMR.cpp line 205:
>> 
>>> 203: 
>>> 204:   ~ThreadScanHashtable() {
>>> 205:       log_trace(thread, smr)("tid=" UINTX_FORMAT ": deallocate ThreadScanHashtable(%d) at " INTPTR_FORMAT, os::current_thread_id(), _table_size, p2i(this));
>> 
>> For a CHeap hashtable, I believe this should do this (or have KVHash have an API to delete all the entries).
>> Dictionary::~Dictionary() {
>>   DictionaryEntry* probe = NULL;
>>   for (int index = 0; index < table_size(); index++) {
>>     for (DictionaryEntry** p = bucket_addr(index); *p != NULL; ) {
>>       probe = *p;
>>       *p = probe->next();
>>       free_entry(probe);
>>     }
>>   }
>>   assert(number_of_entries() == 0, "should have removed all entries");
>> }
>
> This should be added to KVHashtable because it would be nice to migrate the other hashtables to this nicer API.

I don't see how the entries in the table are freed (in any of the KVHashtables).  Maybe I'm missing something.

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

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


More information about the hotspot-runtime-dev mailing list