Tagged articles
2 articles
Page 1 of 1
Tencent Technical Engineering
Tencent Technical Engineering
Mar 24, 2025 · Fundamentals

Understanding V8 Garbage Collection: Scavenger and Mark‑and‑Sweep Algorithms

V8’s garbage collector splits memory into young and old generations, using a fast Scavenger minor‑GC that marks live objects, evacuates them via semi‑space copying, and updates pointers with write barriers, while a concurrent mark‑and‑sweep major‑GC employs three‑color marking, black allocation, sweeping and optional parallel compaction, with adaptive triggering based on heap usage.

Garbage CollectionJavaScriptMark-and-Sweep
0 likes · 30 min read
Understanding V8 Garbage Collection: Scavenger and Mark‑and‑Sweep Algorithms
Tencent Docs Tech Team
Tencent Docs Tech Team
Mar 24, 2025 · Fundamentals

How V8’s Scavenger and Mark‑Sweep Algorithms Optimize JavaScript Memory Management

This article explains V8’s generational heap layout, the Scavenger minor‑GC algorithm with its marking, evacuation and pointer‑updating steps, the parallel Scavenger enhancements, the major mark‑and‑sweep collector with optional compaction, and the various triggers that decide when each garbage‑collection phase runs.

Garbage CollectionJavaScriptMark‑Sweep
0 likes · 30 min read
How V8’s Scavenger and Mark‑Sweep Algorithms Optimize JavaScript Memory Management