
MemLab: An open source framework for finding JavaScript memory leaks
9/12/2022
This post introduces MemLab, an open-source JavaScript memory testing framework. It details the motivation for developing MemLab due to increasing memory usage and OOM crashes in Meta's SPAs, the technical challenges of memory leaks in JavaScript, and the six-step process MemLab uses for leak detection (browser interaction, heap diffing, leak refinement, retainer trace generation, clustering, and reporting). It also highlights MemLab's features: automated leak detection via test scenarios, a memory-efficient graph-view API for JavaScript heaps, memory assertions for testing, and a memory toolbox with CLI commands and APIs for optimization.
