← Back to Browse
Performance

MemProfiler

Track memory leaks in Node.js apps with heap snapshots, allocation tracking, and leak detection.

★★★★☆ 4.4 156 reviews
5.1k installs
v1.3.0 MIT

Install

npx skilldock install mem-profiler

About

MemProfiler instruments your Node.js process to track heap growth, identify retained objects, and pinpoint memory leaks. Features automatic heap snapshot comparison, allocation timeline, garbage collection metrics, and Express middleware that adds memory stats to response headers.

Usage Example

const { profiler } = require("mem-profiler");

// Start tracking
profiler.start({
  interval: "10s",
  snapshots: true,
  threshold: "100MB", // alert if heap exceeds
  dashboard: "/debug/memory"
});

// Manual snapshot
const snapshot = await profiler.snapshot();
console.log(snapshot.leakSuspects);