Update Garbage-Collector-Lazy-Sweeping.md

This commit is contained in:
Justin Ethier 2018-07-25 17:04:46 -04:00 committed by GitHub
parent d2701350d4
commit 9f45f5df70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@
# Introduction
Cyclone uses a concurrent mark-sweep garbage collection algorithm [described in detail here](Garbage-Collector.md). One of the basic improvements to mark-sweep suggested by the [Garbage Collection Handbook](#references) is lazy sweeping.
Cyclone uses a concurrent mark-sweep garbage collection algorithm [described in detail here](Garbage-Collector.md). One of the main improvements to mark-sweep suggested by the [Garbage Collection Handbook](#references) is lazy sweeping.
The basic idea is that instead of having the collector thread sweep the entire heap at once when tracing is finished, each mutator thread will sweep its own heap incrementally as part of allocation. When no more free space is available to meet a request the allocator will check to see if there are unswept heap pages, and if so, the mutator will pick one and sweep it to free up space. This amortizes the cost of sweeping.