In G1 we maintain a lot of region lists (collection set list, young regions list, etc.) but we do so in ad-hoc and inconsistent ways. That code is also very error-prone: one change on this code is known to be followed-up with several assertion failures. We would like to restructure the region lists in G1 to make the code more consistant and easier to maintain. Main requirements of this change are:
- Use a top-level G1HeapRegionList class to maintain all lists (with possible specialized subclasses)
- Each heap region will belong to exactly one list at any time and have a single next field
- The heap region lists will maintain the used space for the entire heap.