TLDR Web Dev · ARTICLES & TUTORIALS

COMMON CAUSES OF MEMORY LEAKS IN JAVASCRIPT

trevorlasn.com18 min read

Summary from the TLDR Web Dev newsletter

Memory usage is tracked in Node.js (V8) with metrics like RSS, Heap Total, Heap Used, External, and Array Buffers. There are various causes of memory leaks, such as improperly managed variables, persistent global objects, unremoved event listeners, closures capturing variables, and circular references. Developers can profile memory usage by using the `--prof` flag and analyzing the resulting profile file to identify areas of potential memory leak.