RFR (M): 8217778: StringTable cleanup miscalculates amount of dead objects
coleen.phillimore at oracle.com
coleen.phillimore at oracle.com
Tue Jan 29 18:22:50 UTC 2019
On 1/28/19 11:02 PM, Kim Barrett wrote:
>> On Jan 28, 2019, at 4:46 PM, coleen.phillimore at oracle.com wrote:
>>
>>
>> Hi Thomas, Can you forward the review thread for JDK-8213229?
>>
>> I wonder if we could just trigger_unloading after any GC has run and ignore dead string counts. Are they ever zero?
> We’re trying to only trigger the ServiceThread’s StringTable cleanup when there
> are enough nulled-out entries to make it worth the effort. My guess would be that
> interned strings rarely die young. In which case that approach would probably
> trigger the ServiceThread unnecessarily frequently. Maybe instead avoid the
> counting and unconditionally trigger after a (possibly concurrent) full collection?
> That doesn’t do so well for the (possibly rare?) application that does frequently
> intern and then drop strings though. Or don’t trigger the ServiceThread more
> often than some (perhaps configurable? Ugh! A new CLOption) frequency.
I definitely don't want another command line option, but triggering
after a collection that might do class unloading makes sense. But yeah,
some cases might have lots of interned strings outside of class
loading. I thought that the stringTable insert code noted dead entries
on the way, but that's only used by the symbolTable.
>
> Also, I wonder if the SymbolTable has the same miscalculation. The SymbolTable
> code was somewhat cribbed from StringTable, after all.
>
Yes, the SymbolTable code was similar but the Symbols are 90-99% brought
in by class loading, so triggering during unloading unconditionally make
sense there. And even when we counted, if there was 1 Symbol free,
we'd clean the table. It's concurrent, and hasn't been seen to cause
undo slowdown on the applications we've benchmarked, so this is good.
See: 8213753: Move timing of ProtectionDomainTable and
ResolvedMethodTable cleanup to service thread
I should split this RFE because this also moves SymbolTable cleaning to
only trigger during unloading.
Coleen
More information about the hotspot-gc-dev
mailing list