JDK-7046182 : G1: remove unnecessary iterations over the collection set
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs21
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-05-18
  • Updated: 2013-09-18
  • Resolved: 2011-09-30
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.
JDK 7 JDK 8 Other
7u2Fixed 8Fixed hs22Fixed
Description
Currently we iterate over the CSet twice in serial mode, once before the GC and once after, to ensure that the RSets of the CSet regions are ready for parallel iteration (some of their fields have to be in a certain state for the correctness of the parallel claiming algorithm).

However, both iterations are pointless given that when a region is added to the CSet it will be collected and then freed (at least in the common case) so its CSet can be reset when the region is freed and be ready when the region is re-allocated and eventually added to the CSet.

One special case is that, when evacuation failure happens, some CSet regions might not be freed but be retained in the heap. In this case, we can reset the appropriate flags on their RSets during evacuation failure handling.

I'll piggyback on this CR the removal of the G1_REM_SET_LOGGING code. Even though it is disabled by default, we have not used for a while and it is of questionable benefit (and also contains two more CSet iterations!).

Comments
EVALUATION See main CR
12-09-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/e8b0b0392037
08-07-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e8b0b0392037
08-07-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/e8b0b0392037
21-06-2011

EVALUATION See Description.
18-05-2011