Skip to content

Commit 0f182e2

Browse files
committed
Address review comments
1 parent 72d0284 commit 0f182e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

InternalDocs/garbage_collector.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ we don't want too much garbage (say 1/3 of the heap maximum), `G0 ≤ L/2`.
528528
For each full scavenge we must visit all objects, `T == L + G0 + G1`, during which
529529
`G1` garbage objects are created.
530530

531-
The number of new objects created `N` must be at least the new garbage created, `N ≥ G`.
531+
The number of new objects created `N` must be at least the new garbage created, `N ≥ G1`,
532+
assuming that the number of live objects remains roughly constant.
532533
If we set `T == 4*N` we get `T > 4*G1` and `T = L + G0 + G1` => `L + G0 > 3G1`
533534
For a steady state heap `G0 == G1` we get `L > 2G` and the desired garbage ratio.
534535

@@ -542,7 +543,7 @@ as reachable and `I` is the number of objects visited in increments.
542543
Everything in `M` is live, so `I ≥ G0` and in practice `I` is closer to `G0 + G1`.
543544

544545
If we choose the amount of work done such that `2*M + I == 6N` then we can do
545-
do less work in most cases, but are still guaranteed to keep up.
546+
less work in most cases, but are still guaranteed to keep up.
546547
Since `I ≥ G0 + G1` (not strictly true, but close enough)
547548
`T == M + I == (6N + I)/2` and `(6N + I)/2 ≥ 4G`, so we can keep up.
548549

0 commit comments

Comments
 (0)