Skip to content

Instantly share code, notes, and snippets.

@bpaquet
Created October 20, 2012 09:47
Show Gist options
  • Save bpaquet/3922818 to your computer and use it in GitHub Desktop.
Save bpaquet/3922818 to your computer and use it in GitHub Desktop.
Zlib leak node v0.8.12
var zlib = require('zlib');
var completed = 0;
function printProcMem() {
if (completed % 100 == 0) {
var mem = process.memoryUsage();
console.log('%d %d %d %d',
completed, mem.rss / 1000000, mem.heapTotal / 1000000, mem.heapUsed / 1000000);
}
zlib.deflate('toto', function(err, buffer) {
if (err) {
console.warn(err);
}
completed += 1;
setTimeout(printProcMem, 10);
})
}
console.log('# Run # RSS # Heap Total # Heap Used');
printProcMem();
setTimeout(process.exit, 300000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment