RFR: 8165443: Free Collection Set serial phase takes very long on large heaps
Stefan Johansson
stefan.johansson at oracle.com
Tue Nov 26 15:01:53 UTC 2019
Hi,
Please review this fix to improve freeing the collection set when having
a lot of regions.
Issue: https://bugs.openjdk.java.net/browse/JDK-8165443
Webrev: http://cr.openjdk.java.net/~sjohanss/8165443/00/
Summary
For heaps with many regions freeing the collections set takes a
considerable amount of time and the big bottleneck is freeing regions
and creating the free list. The approach to fix the problem is to split
the collection set freeing and the free list rebuild into two different
phases. This makes it easier to parallelize the free collection set
phase and to work around sorting regions into the free list we now
rebuild the free list from scratch, handing chunks of the heap to
different workers and then appending them together.
This changes removes the simple heuristic around how many workers to use
for the collection set freeing and instead just caps in the number of
workers to regions in the collection set. I did this because I saw not
improvement using a work chunk size.
I also added a new event and logging for the collection set freeing that
captures the whole parallel time for each worker. I left the old events
and logging for how much time has been spent working on young vs old
regions, but I'm not sure how useful this information is in the logs. I
get that it is needed for predictions, but maybe we can skip the logs
and events? Current version keeps them but I'm very willing to remove
them if others agree.
Testing
Manual performance testing on various benchmarks show good results for
heap with a lot of regions and no regression for heap with a few
regions. Functional tests using mach5 tier 1-5.
Thanks,
Stefan
More information about the hotspot-gc-dev
mailing list