Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

V8 5 min read Announcement hardMaster

Oilpan library · V8

Oilpan, the trace-based C++ garbage collector originally built for Blink, has been extracted into a library hosted in V8 since v9.4 (enabled in Chromium M94) under the cppgc namespace. It marks precisely on the heap and conservatively on the native stack, supports concurrent/parallel marking and sweeping plus compaction, and can run stand-alone (as PDFium does for XFA) or as part of V8's unified JavaScript/C++ heap. Moving it out of Blink cut a ~30k-target build down to seconds for its 400+ unit tests, and V8 now steers embedders off the EmbedderHeapTracer API toward allocating C++ objects on an Oilpan heap attached to an Isolate.

Related posts

  • The V8 Sandbox

    V8 hardMaster

    The V8 Sandbox is a lightweight, in-process software sandbox that isolates the V8 heap so memory corruption from engine bugs cannot spread to the rest of the renderer process. It is now included in Chrome's VRP as of Chrome 123. V8 exploits usually stem from 2nd-order logic bugs, often in JIT compilers, which neither Rust nor memory tagging can prevent. The sandbox therefore replaces raw pointers and 64-bit sizes on the heap with 40-bit offsets from a 1TB reserved region, plus a pointer-table indirection for external objects. Overhead is about 1% on Speedometer and JetStream, and the design is testable through a memory-corruption API and a sandbox-violation detection mode used for fuzzing.

  • V8 release v6.9 · V8

    V8 easyNovice

    V8 v6.9 embeds built-in functions directly into the binary on x64, so all Isolates share one copy instead of each holding up to 700 KB on its own heap. Across the top 10k sites this cut median V8 heap size by 9%, and 10% of sites saved 3.7 MB or more. Liftoff, a new baseline WebAssembly compiler, speeds startup by over 10×. DataView methods were reimplemented in Torque and inlined by TurboFan to match TypedArray speed, and concurrent, incremental and parallel WeakMap processing roughly halves Mark-Compact GC pauses, with a linear-time fallback replacing worst cases that could take seconds. The release also adds Array.prototype.flat and flatMap.

  • Understanding Garbage Collection in JavaScriptCore From Scratch

    WebKit hardMaster

    JavaScriptCore's garbage collector is non-compacting, generational and mostly concurrent, with heavy use of lock-free programming. The explanation starts from a naive stop-the-world generational collector and adds pieces one at a time until it reaches JSC's real design. Along the way it covers BlockDirectory-based allocators (CompleteSubspace, PreciseAllocation, IsoSubspace), why per-object metadata is split between an inlined cellState and outlined isNew/isMarked bitvectors, and how write barriers and remembered sets keep marking correct. For incremental and concurrent collection it adds remembered-set scheduling and Space-Time Scheduler mitigations, which address up to 5x memory blowup.

  • Celebrating 10 years of V8 · V8

    V8 easyNovice

    V8 grew over ten years from a secret project started in 2006 on a Danish farm into a JavaScript and WebAssembly engine supporting eight instruction sets, embedded by both Chrome and Node.js. Key milestones include the Irregexp regex engine, the Crankshaft and later TurboFan optimizing compilers, the Ignition interpreter, the incremental and then Orinoco parallel/concurrent garbage collectors, idle-time GC, code caching, Liftoff, and Spectre mitigations. V8 Bench scores rose 4× from 2008 to 2018, with dips from the initial ES2015 features and Spectre mitigations. The curve flattens after 2013 because the team shifted from synthetic micro-benchmarks to real-world performance, and Speedometer 1 scores rose another 4× over 2013–2018.

  • Debugging JavaScript Memory Leaks

    Bun mediumAdept

    Bun implements V8's writeHeapSnapshot API, so heap snapshots can be loaded and diffed in Chrome DevTools, where a steadily growing Delta column reveals leaks. bun:jsc's heapStats also reports per-type object counts, including objects protected from GC. Passing a Blob instead of a Uint8Array to repeated Response objects cut memory from ~1 GB to ~60 MB by avoiding per-Response copies. Common leak sources are closures retaining JSLexicalScope objects, active AbortSignals kept reachable by listeners (shown via JSC's isReachableFromOpaqueRoots), bound functions, and EventEmitter listeners that are never removed.

The quest for software engineering knowledge.

Look:
Layout: