G1 Maintains a linked list of all young regions in the class YoungList.
Young regions are also added to the incremental collection set when they are retired as allocation regions. This means that the only time when a region is not on both the YoungList and the incremental collection set is while it's being used as a mutator alloc region. One notable difference between these lists is that the regions may get added to the incremental collection set in a different order compared to the young list order due to the possibility of multiple mutator alloc regions.
The main consumers of the YoungList linked list are a few pieces of verification code and the YoungRemSetSamplingThread.
The fact that the sampling thread is scanning the remembered sets of regions which can be mutator alloc regions is kind of broken since it's unlikely that they will contain any large amount of remembered set entries yet and the refinement threads must be very good at keeping up for that to happen.
WithJDK-8150393 the survivor regions are explicitly tracked in an array and having tis array this allows us to get rid of all the linked lists in YoungList and the _next_young_region linked list pointer in HeapRegion.
Young regions are also added to the incremental collection set when they are retired as allocation regions. This means that the only time when a region is not on both the YoungList and the incremental collection set is while it's being used as a mutator alloc region. One notable difference between these lists is that the regions may get added to the incremental collection set in a different order compared to the young list order due to the possibility of multiple mutator alloc regions.
The main consumers of the YoungList linked list are a few pieces of verification code and the YoungRemSetSamplingThread.
The fact that the sampling thread is scanning the remembered sets of regions which can be mutator alloc regions is kind of broken since it's unlikely that they will contain any large amount of remembered set entries yet and the refinement threads must be very good at keeping up for that to happen.
With