You can use node-inspector and v8-profiler to do this. Install it from npm:
$ npm install v8-profiler
And then use it to get heap snapshots (taken from the instructions):
var profiler = require('v8-profiler'); var snapshot = profiler.takeSnapshot([name])
source share