~/talk

Memory Leaks in JavaScript

Talkat jsday 2025 · 2025-04-07..04-08· [web-performance, testing]
slides:none on file

Shows how to find and fix concrete leaks using MemLab and Chrome DevTools with live demos: creating 10,000 divs and taking heap snapshots that show a +1.2 MB delta, inspecting detached DOM nodes, implicit globals, closures that keep whole arrays, and forgotten intervals or event listeners. Walks through taking snapshots, using comparison and statistics, nulling references, removing listeners or clearing timers, and extracting single values instead of retaining big arrays; notes MemLab automates leak detection but can take substantial time to run.

AI-written summary · about

  1. 0:00Memory leaks in JavaScript
  2. 1:03Memory management basics
  3. 3:38Memory leak definition and impact
  4. 5:01Stack vs heap memory
  5. 7:12Stack overflow and heap issues
  6. 8:16Garbage collection mark and sweep
  7. 11:32Demo: memory leak in Chrome DevTools
  8. 14:03Heap snapshots for leaks
  9. 17:27Global variables as leaks
  10. 19:58Fixing global leaks with let/const
  11. 21:47Detached DOM nodes cause leaks
  12. 23:12Closures and memory leaks
  13. 25:24Closures and timeouts
  14. 25:44Event listeners and intervals
  15. 26:30MemLab for leak detection
  16. 27:56Heap analysis with timeline profiler
  17. 29:01Maps and sets prevent leaks
  18. 30:05Summary: leaks and tools
~/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.