RFR: 8184765: Dynamically resize SystemDictionary
Karen Kinnear
karen.kinnear at oracle.com
Fri Oct 13 10:42:50 UTC 2017
A quick note - we are resizing the hash table, i.e. number of linked lists, so as to speed up lookup if it is too small, or waste less space if it is
too large. Each dictionary may have multiple entries off of it - one per loaded class - so there is no such thing as running out
of space based on the sizing (just based on total OOM). I have not yet looked at the change - but just wanted to clarify the
goal and concept for folks first.
thanks
Karen
> On Oct 11, 2017, at 4:10 PM, coleen.phillimore at oracle.com wrote:
>
>
> Gerard, some preliminary comments.
>
> http://cr.openjdk.java.net/~gziemski/8184765_rev1/src/hotspot/share/classfile/systemDictionary.cpp.udiff.html
>
> *+{*
> *!_MutexLocker mu(SystemDictionary_lock, THREAD_);*
> *!_Klass* probe = dictionary->find(_d_hash, name, protection_domain);*
> *if (probe != NULL) return probe;*
> **
> *+ }*
>
> I don't think you need this because dictionary->find() should have the NoSafepointVerifier, so the index will not change.
>
> http://cr.openjdk.java.net/~gziemski/8184765_rev1/src/hotspot/share/classfile/classLoaderData.cpp.udiff.html
>
> I think we want a global _some_dictionary_needs_resizing to avoid walking through the CLDG.
>
> And have Dictionary have a field _resizing_needed to avoid the calculation during the safepoint, which is set when adding an entry.
>
> _resizing_needed = *(number_of_entries() > (_resize_load_trigger*table_size());
> *CLDG::_any_resizing_needed |= _resizing_needed; // or something like that.
>
> I can write more about the rationale of this change in the bug report, if needed.
>
> Thank you for doing this change.
> Coleen
>
>
> On 10/10/17 4:40 PM, Gerard Ziemski wrote:
>> hi all,
>>
>> Please review this change that adds dynamic resizing of system dictionaries.
>>
>> The biggest change is refactoring of the code that protects calculating of the table entry’s index using SystemDictionary_lock
>>
>> A few notes:
>>
>> - dynamic resizing is off when either dumping or using shared spaces
>> - we remove the experimental runtime option “PredictedLoadedClassCount” and add “DynamicallyResizeSystemDictionaries” to turn the resizing off (it’s on by default)
>> - the jtreg test uses stream of bytes to dynamically load numbered classes from memory instead of disk (thank you Ioi)
>>
>> bug: https://bugs.openjdk.java.net/browse/JDK-8184765
>> webrev: http://cr.openjdk.java.net/~gziemski/8184765_rev1
>>
>>
>> cheers
>>
>
More information about the hotspot-runtime-dev
mailing list