Currently the collection set is materialized using pointer members in the HeapRegion class, using a "next" pointer.
This is problematic in various ways:
- messes up the HeapRegion class with an additional member that is only used for a small part of the regions anyway.
- it is not thread safe, and actually the sampling thread iterates over this linked list without any proper memory barriers, potentially causing crashes or at least problems with the prediction (using wrong values)
- the change to free the collection set (JDK-8034842) in parallel needs to be extra cautious to not read old values.
Fix this as suggested in the CR title.