@airbnb/node-memwatch
Version:
Keep an eye on your memory usage, and discover and isolate leaks.
23 lines (11 loc) • 279 B
JavaScript
const
memwatch = require('..'),
url = require('url');
function LeakingClass() {
}
memwatch.gc();
var arr = [];
var hd = new memwatch.HeapDiff();
for (var i = 0; i < 10000; i++) arr.push(new LeakingClass);
var hde = hd.end();
console.log(JSON.stringify(hde, null, 2));