Open phymo opened 2 years ago
in Browser,
浏览器中抓取内存的dump相对来说简单些,直接通过谷歌浏览器的调试工具找到memory对应的tab页面,然后点击Load即可开始抓取内存dump,
In node.js:
> npm install heapdump
const heapdump = require('heapdump');
heapdump.writeSnapshot('start.heapsnapshot'); // 记录应用开始时的内存dump
// 应用code部分
heapdump.writeSnapshot('end.heapsnapshot'); // 记录应用结束时的内存dump
Closure