Orinoco: Young Generation Garbage Collection
2 days ago
- #V8
- #JavaScript
- #Garbage Collection
- JavaScript objects in V8 are managed on a heap by V8’s garbage collector, which reduces pause times and memory consumption.
- The parallel Scavenger is a new feature of Orinoco, V8's concurrent and parallel garbage collector.
- V8 uses a generational heap with a nursery, intermediate, and old generation; objects move up after surviving collections.
- Before V8 version 6.2, a single-threaded Cheney semispace copying collector was used for young generation collections.
- The parallel Scavenger, introduced in v6.2, utilizes dynamic work stealing across threads for better performance.
- An alternative parallel Mark-Evacuate algorithm was tested but had overhead due to separate lockstep phases.
- The parallel Scavenger merges marking, copying, and pointer updating phases for improved throughput and efficiency.
- It utilizes per-page remembered sets for root distribution and work stealing for load balancing.
- Performance improvements include 20%–50% reductions in young generation garbage collection time on benchmarks.
- The parallel Scavenger is optimized for modern multi-core environments, including Arm big.LITTLE architectures.