Created
October 26, 2012 13:50
-
-
Save julien51/3958940 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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