Offline analyzer for V8 .heapsnapshot files (Chrome / Node) that opens
snapshots too big for the DevTools UI. Two tools, zero dependencies, Node 18+.
node --max-old-space-size=8192 heapkit.js <file.heapsnapshot> [summary|find <re>|retain <#id|name>|detached|buffers]
summarytop constructors by count / self-sizefindobjects/closures matching a regexretainretainer path to GC root (the reason it leaks)detacheddetached DOM nodes (browser leaks)bufferslargest ArrayBuffers + who retains themdiff <after>compare two snapshots; shows which constructors grew (proves a leak)
node --max-old-space-size=8192 heap-secrets.js <file.heapsnapshot> [--full]
Scans live strings for JWTs, Google/AWS/Stripe/GitHub/Slack keys, bearer tokens, OAuth codes, session cookies, private keys, and plaintext password fields. Values are masked by default. Real snapshots routinely retain auth tokens long after the UI "logged out" — this finds them.
Pair them: heap-secrets.js finds a token, heapkit.js retain shows what keeps
it alive.
MIT.