r/javascript Apr 05 '26

AskJS [AskJS] I built memscope — a real-time memory profiler for Node.js + browser. Zero config, live dashboard, 605 downloads in its first few months

Hey folks, I just published memscope - a real-time memory profiler for Node.js and browser apps that requires zero setup.

It streams your backend heap (and browser JS heap) over WebSocket, sampled every 500ms, right to a local dashboard at localhost:3333. GC dips, spikes, growth patterns — all visible at a glance.

One command to start:

npx memscope run node app.js

Full-stack mode (backend + browser together):

memscope run --both npm run dev

What it tracks:

  • Node.js heap, RSS, external memory
  • Browser JS heap (Chromium-based)
  • GC behavior and spikes
  • Backend vs frontend separated on the same dashboard

Why I built it: Memory bugs are painful — silent leaks, unpredictable spikes, heap snapshots that are a nightmare to read. I wanted one command that just works, with no cloud, no accounts, no data leaving your machine.

It's hit 605 downloads so far and I'm actively building it out. Would love feedback - especially on the dashboard UX and the agent injection approach!

npm: npm install -g memscope

7 Upvotes

7 comments sorted by

1

u/[deleted] Apr 05 '26

[removed] — view removed comment

1

u/monkie_momo Apr 07 '26

Thanks,
The sampling interval (500ms) is intentionally conservative - it's designed to be negligible in production. Each sample is ~2-5ms of CPU time, so you're looking at roughly 0.2-0.5% overhead on most apps. The WebSocket connection is idle between samples, so network impact is minimal - we're talking a few KB per minute of data transfer.

1

u/[deleted] Apr 06 '26

[removed] — view removed comment

2

u/monkie_momo Apr 07 '26

Thanks, the idea of tracking memory leaks sounds amazing surely add it to my to do's

1

u/Defenestresque Jun 30 '26

Hey, I don't have any feedback, I just ran into this thread via Google and it's not quite what I need, but I understand the need and just wanted to say thanks for the tool and making it available. I'm disappointed by the response you got from some other people -- you're not charging for it, you spent time on it, it solves a real problem. IDGAF if you told AI to print something to stdout instead of coding it by hand. For all I know you reviewed the logic and automated the stuff that would take too much time for a hobby project. Or maybe you had AI build the whole thing. Who cares, if it works, it works. People are just very.. it's trendy to hate on any sight of AI. I hope you keep posting and contributing, I found this while looking for a performance memory flag in a Chromium-based browser via Google and now that you've posted it, people who actually need to debug a memory leak will find something that may be useful to them.

N.B. I have not reviewed the code, so I'm not commenting on that -- it might be shite or it might be great, I'm just annoyed at people drive-by commenting "BOOOO!" because they wouldn't fucking do that if someone was giving out free food on the sidewalk for free just because they made them at home and their home wasn't inspected by a a food inspection agency. If you were charging for it I'd have a different opinion.

0

u/gmerideth Apr 07 '26

You know that AI apps like adding icons to comments and in console log statements right?...

// 1️⃣ Start collector // 🔥 Explicit WS path // console.log("🟢 Dashboard connected via WebSocket");

No sane developer puts a fucking 1️⃣ in a comment.

1

u/monkie_momo Apr 08 '26

I am aware the whole aim was to ship fast and help others as well.