Parallel reference processingq
sangheon.kim at oracle.com
Tue Jun 6 17:44:06 UTC 2017
On 06/06/2017 01:26 AM, Kirk Pepperdine wrote:
> I’m keep running into cases where reference processing dominates the pause times budget (no matter which collector is configured). In all cases configuring parallel reference processing helped enormously. Reference processing is single threaded by default. I’m wondering if there is a reason why reference processing could be parallel by default or parallelized if the workload exceeds a reasonable threshold.
The biggest reason that I think is in some cases - if there are not many
references - single thread case is faster. Of course, this is
controversial as choosing a benchmark will show different results.
Probably big enough applications tend to have many references. But this
is why we don't set 'ParallelRefProcEnabled=true' as a default.
Current implementation spends some time on starting/stopping worker
threads. We start and stop worker threads 9 times (3 for SoftReference
and 2 times for other types) for reference processing. And this results
in slower than single thread case in some cases.
JDK-8043575 <https://bugs.openjdk.java.net/browse/JDK-8043575> is
proposing to dynamically switch between MT and single thread. And there
are other CRs to enhance references processing.
I have a prototype but need more refining. Please keep on eye on this if
you are interested. (Thanks, Aleksey for the link at the other email thread)
: e.g. Most of Specjvm2008 sub-tests don't use references. Derby is
exceptional case that shows over 12k FinalReferences. So single thread
is faster except Derby case.
> Kind regards,
> Kirk Pepperdine
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-dev