A Node.js library for writing memory leak tests using Mocha or other test runners.
Leakage is a Node.js library for detecting memory leaks in JavaScript applications by writing automated tests. It runs iterator functions multiple times, captures heap snapshots, and analyzes diffs to identify memory that isn't being garbage collected. This helps developers catch leaks early and prevent regressions in their code.
Node.js developers and teams who need to ensure their applications are memory-efficient and free from leaks, particularly those working on long-running processes or performance-critical systems.
Developers choose Leakage because it integrates directly into existing test workflows with frameworks like Mocha, provides both synchronous and asynchronous testing support, and offers customizable parameters for accurate leak detection without requiring deep expertise in memory management.
🐛 Memory leak testing for node.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses heap diff analysis to automatically identify memory leaks by running iterator functions multiple times, catching regressions early as highlighted in the philosophy.
Seamlessly integrates with Mocha and Tape, allowing memory tests to be part of existing test suites without major changes.
Provides iterate.async() for testing asynchronous operations, returning promises for easy integration with async/await workflows.
Allows adjustment of iterations and garbage collections via options to balance test accuracy and performance, as detailed in the API.
Tests are inherently slow due to heap snapshotting and multiple garbage collections, as admitted in the FAQ about timeouts and performance.
Requires specific configuration for CI environments like Travis CI, including installing g++ 4.8 to compile dependencies, adding overhead.
Designed only for Node.js environments, not suitable for browser JavaScript or other runtimes, restricting its applicability.
Background noise in heap diffs can lead to false positives, especially in async tests, requiring careful interpretation and serial execution.