Skip to content

Commit 21dbce9

Browse files
committed
* more typos, grammar etc.
* tried to clarify the `to-collection-set` color
1 parent a4f9ada commit 21dbce9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

_posts/2025-02-21-new-write-barriers.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ The original card marking paper uses two different values for card table entries
147147

148148
* **clean** - the card does not contain an interesting reference.
149149
* **dirty** - the card may contain an interesting reference.
150-
* **already-scanned** - used during garbabge collection to indicate that this card has already been scanned.
150+
* **already-scanned** - used during garbage collection to indicate that this card has already been scanned.
151151
* **to-collection-set** - the card may contain an interesting reference to the areas of the heap that are going to be collected in the next garbage collection (the **collection set**, hence the name). This collection set always contains the young generation.
152152

153-
Refinement can skip scanning these cards because it will always be scanned during garbage collection because G1 always collects the young generation. Adding this card to the remembered sets is not needed, it would actually be duplicate information.
153+
Refinement can skip scanning these cards because they will always be scanned during garbage collection as G1 always collects the young generation. Adding these cards to remembered sets, even if they contained references to regions not in the collection set, is not needed, they would actually represent duplicate information.
154154

155-
For simplicity in the write barrier, it only colors cards as "Dirty": the additional overhead in finding out whether this has been a reference to an object in the collection set is too expensive here.
155+
Effectively this also stores the entire remembered set for the next collection set on the card table, avoiding extra memory usage.
156+
157+
For simplicity of the write barrier, it only colors cards as "Dirty": the additional overhead finding out whether a reference refers to an object in the collection set is too expensive here.
156158
* **from-remset** - used during garbage collection to indicate that the origin of this card is a remembered set and not a recently marked card. This helps distinguishing cards from remembered sets from cards from not yet examined cards to more accurately model the application's card marking rate used in heuristics.
157159

158160
The last two card colors are new. The use of the to-collection-set color explains the condition used in line (3) of the write barrier above: it avoids overwriting this value excluding benign races.

0 commit comments

Comments
 (0)