memlab  by facebook

JavaScript memory leak detection and heap analysis framework

Created 4 years ago
4,972 stars

Top 9.9% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

A framework for finding JavaScript memory leaks and analyzing heap snapshots, MemLab targets developers and researchers working with web applications, Node.js, Electron.js, and Hermes. It automates the detection of memory leaks and provides tools for in-depth analysis and optimization opportunities, aiming to improve application performance and stability.

How It Works

MemLab employs Puppeteer to script browser interactions and capture JavaScript heap snapshots. It then analyzes these snapshots to identify memory leaks using built-in detectors or custom JavaScript filters. An object-oriented heap traversal API enables programmatic analysis of heap data from various JavaScript runtimes, including Chromium-based browsers, Node.js, Electron.js, and Hermes. The framework also includes a CLI toolbox and MemLens for interactive debugging and visualization of memory issues.

Quick Start & Requirements

Highlighted Details

  • End-to-end testing and analysis framework for JavaScript memory leaks and optimization.
  • Object-oriented heap traversal API for custom leak detectors and programmatic analysis across multiple JS environments.
  • MCP server integration for AI coding assistants to interactively analyze heap snapshots via natural language.
  • MemLens utility for visualizing memory leaks and interactive debugging within the browser.
  • Memory assertion capabilities for Node.js unit tests to check heap state.

Maintenance & Community

The project provides contributing guides and a Code of Conduct, but does not explicitly list notable contributors, sponsorships, or community channels like Discord/Slack in the README.

Licensing & Compatibility

MemLab is MIT licensed. No specific restrictions for commercial use or closed-source linking are mentioned.

Limitations & Caveats

Browser leak detection primarily targets Chromium-based environments. For detailed retainer traces, the website under test should serve non-minified code or code with readable variable names. Development on Windows requires Git Bash for building.

Health Check
Last Commit

18 hours ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
26 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), Hiroshi Shibata Hiroshi Shibata(Core Contributor to Ruby), and
6 more.

oss-fuzz by google

0.2%
12k
Continuous fuzzing for open source software
Created 9 years ago
Updated 22 hours ago
Feedback? Help us improve.