Created
October 20, 2012 09:47
-
-
Save bpaquet/3922818 to your computer and use it in GitHub Desktop.
Zlib leak node v0.8.12
This file contains 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
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