JDK-8159978 : Use an array to store the collection set regions instead of linking through regions
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-21
  • Updated: 2018-06-21
  • Resolved: 2016-07-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
9 b129Fixed
Related Reports
Blocks :  
Relates :  
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.
Created as "bug" because there is a (possibly benign) memory ordering issue because of this in the existing code.