Big list of resources on Javascript memory
Finding resources to help you when you're trying to fix a memory problem can be a real pain. There's no central source of knowledge, information is scattered everywhere and a lot of the articles are already outdated.
So, I tried to compile a list of articles I found useful and tried also make it clear when they were written, to bring the recent information up front :) Don't skip some of the older videos & articles though, they're still packed with good stuff.
Hope you find this useful!
Official Chrome Docs
- Javascript Memory Profiling - How to find common memory issues using DevTools Timeline, Heap profiles and Heap allocations
- How to record heap snapshots
- Memory terminology - Explains what a retaining tree is, dominators etc
Videos
- A Trip Down Memory Lane with Gmail and Chrome DevTools (2013) [42min] - at Google I/O and, related, slides from WebPerf Days - BloatBusters: Eliminating memory leaks in Gmail (2012)
- Memory Management Masterclass with Addy Osmani (2014) [55min] - also has slides and code samples
- The Breakpoint, Ep. 8: Memory Profiling with Chrome DevTools (2013) [26min]
- Profiling in the wild by Sam Saccone (2015) [8min]
- Discover DevTools - Memory profiling @Code School (2014) [7min]
How-to articles
- Taming the unicorn: Easing JavaScript memory profiling in DevTools by Addy Osmani (2013)
- Finding memory leaks by Tony Gentilcore (2011)
- 4 types of leaks in Javascript and how to get rid of them by Auth0 Blog (2016)
- Hunting a Ghost - Finding a Memory Leak in Node.js by RisingStack blog (2015)
- Case Study: Finding a Node.js Memory Leak in Ghost by RisingStack blog (2016)
- Avoiding a Memory Leak Situation in JS by Imgur (2013) - goes over leaks caused by closures
- Memory profiling by Thorsten Lorenz (2014)
- Writing Fast Memory Efficient Javascript by Smashing Magazine (2012)
- Fixing Memory Leaks in AngularJS and other JavaScript Applications by Dave Kerr (2015)
Reference
- Memory management @MDN, describes memory lifecycle, garbage collection
- A tour of V8: Garbage Collection (2014)
Tools
- Memory stats - shows a memory badge in Chrome
- Drool - automatic memory leak detection and analysis
Comments ()