From 0748b54eae81894480faa1a22eb058091571ade8 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 30 Nov 2022 15:15:26 -0500 Subject: [PATCH] Update Garbage-Collector-Revised-2022.md --- docs/Garbage-Collector-Revised-2022.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/Garbage-Collector-Revised-2022.md b/docs/Garbage-Collector-Revised-2022.md index aa12550d..60505e45 100644 --- a/docs/Garbage-Collector-Revised-2022.md +++ b/docs/Garbage-Collector-Revised-2022.md @@ -470,15 +470,13 @@ When a mutator exits a (potentially) blocking section of code, it must call anot ## Running the Collector -Cyclone checks the amount of free memory as part of its cooperation code. A major GC cycle is started if the amount of free memory dips below a threshold. - -Additionally, during a slow allocation the mutator checks how many heap pages are still free. If that number is too low we trigger a new GC cycle. +Cyclone checks the amount of free memory as part of its cooperation code. A major GC cycle is started if the amount of free memory dips below a threshold. Additionally, during a slow allocation the mutator checks how many heap pages are still free. If that number is too low we trigger a new GC cycle. The goal is to run major collections infrequently while at the same time minimizing the allocation of new heap pages. ### Collector Thread -As well as coordinating major GC the main job of the collector thread is now just tracing. +As well as coordinating major GC the main job of the collector thread is tracing. During this phase the collector visits all live objects and marks them as being in use. Since these objects are stored all across the heap the tracing algorithm cannot take advantage of object locality and tends to demonstrate unusual memory access patterns, leading to inefficient use of the processor cache and poor performance. This makes tracing an excellent task to be done in parallel with the mutator threads so it does not slow down application code.