Skip to content

Garbage Collection

Garbage collection (GC) is automatic memory management. JavaScript engines periodically find and free memory that is no longer reachable.

  • Understand the mark-and-sweep algorithm
  • Learn V8’s generational GC approach
  • Identify what causes memory leaks
  • Apply best practices to help the GC
TopicDescriptionEst. Time
Mark-and-SweepThe core GC algorithm15 min
Generational GCV8’s young/old generation strategy15 min
Common LeaksWhat prevents GC from working10 min
  • Memory management basics
  • Understanding of object references
  • Scope and closures
Mark-and-Sweep → Generational GC → Common Leaks