Q65: How does V8 handle Garbage Collection in Node.js?
V8 uses a generational garbage collector dividing memory into Young Generation (Scavenge algorithms for short-lived objects) and Old Generation (Mark-Sweep-Compact for long-lived objects).
Key Takeaways
- Generational memory structure: Young and Old Generation.
- Uses Scavenger for quick short-lived sweeps and Mark-Sweep for long-lived objects.
Knowledge Check
Which garbage collection algorithm handles short-lived objects in V8's Young Generation?