~/talk

Trash Talk - Understanding Memory Management

Talkat Wey Wey Web 2025 · 2025-11-17..11-18· [nodejs, javascript]
slides:none on file

Explains how V8 uses mark-and-sweep plus generational heaps (young vs. old) to collect most short‑lived JS objects quickly, while promoting survivors to reduce work; demonstrates real leak patterns—accidental globals, bad closures, forgotten timers, detached DOM elements—and shows using Chrome DevTools heap snapshots to compare retained objects and find retainers. Recommends WeakMap/WeakSet to avoid DOM/map leaks and mentions FinalizationRegistry only as a last‑resort cleanup tool; includes concrete fixes like clearInterval, scoping with let/const, and removing map entries.

AI-written summary · about

  1. 0:00Introduction to memory management
  2. 2:55Why garbage collection matters
  3. 7:13Memory lifecycle stages
  4. 10:05Reference counting limits
  5. 11:52Mark and sweep explained
  6. 13:59V8 garbage collection
  7. 17:12Common memory leaks
  8. 18:15Fixing accidental globals
  9. 19:41Bad closures explained
  10. 20:44Timer memory leaks
  11. 22:10Detached DOM elements
  12. 23:14Heap snapshots tool
  13. 24:39Weak maps and sets
  14. 26:26Finalization registry
  15. 27:28Best practices summary
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.