~/talk

Understanding Node.js Garbage Collection

Talkat NodeTLV 2023 · on Wednesday, 2023-06-28· [nodejs]
slides:none on file

Explains that Node.js uses V8 GC and shows concrete behavior: V8 runs a generational GC with a scavenger (minor GC) copying collector for short-lived objects and a mark-sweep-compact major GC for old objects, uses write barriers for concurrent marking, and runs mostly concurrently but sometimes stops the world. Live demo allocates 1,000,000 objects: when references are dropped memory peaks ~7.5MB then settles ~12MB with no major GC; when references are retained it ends at ~99MB and a mark-compact step reduces 47MB to 37MB.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 0:42V8 garbage collector basics
  3. 3:51Memory leaks explained
  4. 6:25Stop the world GC impact
  5. 9:43Generational garbage collection
  6. 11:08V8 GC optimizations
  7. 13:16Scavenger minor GC
  8. 16:31Major GC Mark-Sweep-Compact
  9. 19:21GC execution flow
  10. 19:45Live demo setup
  11. 21:10Demo memory leak impact
  12. 22:34Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.