Scavenge
V8's fast garbage collection for new space, which copies the few surviving young objects elsewhere and frees everything else at once.
In more detail
Because most objects die young, a scavenge touches little memory and pauses the program only briefly. Objects that survive twice are promoted to old space.
Related terms
- garbage collection — The automatic freeing of memory held by objects that the program can no longer reach.
- heap space — One of the separate regions V8 divides its heap into, such as new space for young objects and old space for long-lived ones.
- Mark-Sweep-Compact — V8's full garbage collection for old space: mark every object still reachable, sweep away the rest, then compact memory to close the gaps.
Taught in
- Node.js Process Architecture: Memory & Heap Spaces — Node.js Internals & Backend Services