Skip to content

Instantly share code, notes, and snippets.

@julien51
Created October 26, 2012 13:50
Show Gist options
  • Save julien51/3958940 to your computer and use it in GitHub Desktop.
Save julien51/3958940 to your computer and use it in GitHub Desktop.
require('nodetime').profile({stdout: true});
// It is important to use named constructors (like the one below), otherwise
// the heap snapshots will not produce useful outputs for you.
function LeakingClass() {
}
var leaks = [];
setInterval(function() {
for (var i = 0; i < 100; i++) {
leaks.push(new LeakingClass());
}
console.error('Leaks: %d', leaks.length);
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment