United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6680687 G1: reduce remembered set updating during GC pauses
JDK-6680687 : G1: reduce remembered set updating during GC pauses

Details
Type:
Enhancement
Submit Date:
2008-03-27
Status:
Resolved
Updated Date:
2010-04-04
Project Name:
JDK
Resolved Date:
2009-02-13
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs14 (b06)

Related Reports
Backport:
Backport:

Sub Tasks

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
EVALUATION

See Description.
                                     
2008-03-27
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.
                                     
2008-06-27



Hardware and Software, Engineered to Work Together