heapsnapshot
A Programmatic API for a heapsnapshot.
Currently supports dumps from:
- chrome/v8
usage:
yarn add heapsnapshot
npm install heapsnapshot
heaps can be quite large, and this library isn't terribly efficient yet so at times you may need to run with note with node --max_old_space_size=4096 <script-name>
const Heapsnapshot = ;const snapshot = Heapsnapshot; // get all nodesconst nodes = ...snapshot;const containers = nodes; let path = Heapsnapshot;console;// => <Container:622248> -> <Class:140976> -> <Window / http://localhost:4200:13800> -> root
or if you can use for .. of
:
const Heapsnapshot = ;const snapshot = Heapsnapshot; // loop through all nodesfor const node of snapshot if nodetype === 'object' && nodename === 'Container' const path = Heapsnapshot; console; // => <Container:622248> -> <Class:140976> -> <Window / http://localhost:4200:13800> -> root
Stuff
Node
nodein // => array in in-bound edgesnodeout // => array in in-bound edgesnode // => "<Container: 622248>"
Edge
edgeto // => node the edge points toedgefrom // => node the edge comes fromedge // => "<name: from(Container: 622248) to ((map descriptors): 625980)"