Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memlab

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memlab

memlab is a framework that analyzes memory and finds memory leaks in JavaScript applications.

  • 1.0.1-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
72K
increased by5.91%
Maintainers
2
Weekly downloads
 
Created
Source

memlab

memlab is an E2E testing and analysis framework for finding memory leaks in-browser JavaScript Code. The CLI Toolbox and library provide extensible interfaces for analyzing heap snapshots taken from Chrome, Node.js, Hermes, and Electron.js.

CLI Usage

Install the CLI

npm install -g @memlab

Find memory leaks in Google Maps:

wget -q -O test-google-maps.js https://tinyurl.com/4yr5watu
memlab run --scenario test-google-maps.js

View which object keeps growing in size during interaction in the previous run:

memlab analyze unbound-object

Analyze pre-fetched v8/hermes .heapsnapshot files:

memlab analyze unbound-object --snapshot-dir <DIR_OF_SNAPSHOT_FILES>

Use memlab analyze to view all memory analyses. For extension, view the doc site.

View retain trace of a particular object:

memlab report --nodeId <HEAP_OBJECT_ID>

Use memlab help to view all CLI commands.

APIs

Use the memlab library to start a E2E run in browser and detect memory leaks.

const memlab = require('memlab');

const scenario = {
    // initial page load url
    url: () => 'https://www.google.com/maps/@37.386427,-122.0428214,11z',

    // action where we want to detect memory leaks
    action: async (page) => await page.click('button[aria-label="Hotels"]'),

    // action where we want to go back to the step before
    back: async (page) => await page.click('[aria-label="Clear search"]'),
}
memlab.run({scenario});

Keywords

FAQs

Package last updated on 16 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc