JDK-6680687 : G1: reduce remembered set updating during GC pauses
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-03-27
  • Updated: 2010-04-04
  • Resolved: 2009-02-13
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 6 JDK 7 Other
6u14Fixed 7Fixed hs14Fixed
Description
Right now, at the beginning of a GC pause, we scan all pending update buffers, scan all cards pointed to by said update buffers, and update all remembered sets accordingly. It turns out, however, that there are a couple of opportunities for optimization.

1) We don't need to update remembered sets of any of the regions in the collection set. We explicitly keep track of references into the collection set during remembered set scanning, so there's no point in actually updating the remembered sets. Also, after the collection, all regions in the collection set will be reclaimed, along with their remembered set, so it is pointless to actually update their remembered sets.

2) We don't need to actually scan cards that are included in the collection set, as we will scan the objects in the collection when they are evacuated.

The only problem with doing the above two optimizations is that if an evacuation failure happens, the heap will be left in an inconsistent state with lots of missing remembered sets, as some of the regions in the collection set will not actually move. The solution is to explicitly scan regions with evacuation failure at the end of the collection in order to update any remembered sets we're still missing.

Comments
SUGGESTED FIX The fix for item 2) in the Description is straightforward: just don't scan cards on the collection set, but if an evacuation failure happens rescan the collection set and recreate any RSet entries you might have missed.
27-06-2008

EVALUATION See Description.
27-03-2008