Weak Ref Processing

Aleksey Shipilev shade at redhat.com
Mon Apr 1 20:27:23 UTC 2019


On 4/1/19 9:59 PM, Roman Kennke wrote:
>>> because precleaning takes care of them
>>
>> The precleaning running in the concurrent cycle (Traversal Mode) takes in
>> our case significant portion of the concurrent cycle. Not sure,
>>
>> but the source code indicates to me that the precleaning is done with 1
>> worker only (not using all ConcGCThreads threads available).
>>
>> Something to be improved?
> 
> yes, maybe. we're looking into it. It's possible that the relevant code is not actually
> multithread-safe. Not sure what the reason was to make it 1-threaded.

Shenandoah calls into shared code for precleaning. That code is single-threaded. We have a todo item
to improve (parallelize) it.

I should have noted that pre-cleaning (well, skipping discovery) is also done during discovery in
mark. Post-mark precleaning handles the cases where referent got marked _after_ the reference was
discovered. I remember profiling some applications and seeing the overwhelming majority of weakrefs
was ignored on discovery.

-Aleksey



More information about the shenandoah-dev mailing list