A tool to take a heap snapshot via V8 profiler, which is inspired by Understanding Garbage Collection and hunting Memory Leaks in Node.js
- Node.js >= 6.4.0
- OSX: This code is only pass-test on OSX platform
npm install heapsnapshot.js
add this code to the start
require('heapsnapshot.js').init()
heapsnapshot.init([dataDir][,options])
dataDir
the path of folder for heap snapshot file. Default:.
options
interval
the interval millisecond to check the usage of memory. Default:500
step
: the distance between two adjacent threshold. Default:50
threshold
: the initial threshold. Default:0