Last active
August 29, 2015 14:09
-
-
Save hayes/9cd72c430277b811cab4 to your computer and use it in GitHub Desktop.
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 fs = require('fs') | |
var stream = fs.createWriteStream('test_log.log', {flags: 'w+'}) | |
var buf = new Buffer('im just a little string, log me out and watch mem grow\n', 'utf8') | |
var start = Date.now() | |
function log() { | |
for(var i = 0; i < 1000; i++) { | |
stream.write(buf) | |
} | |
console.log(process.memoryUsage()) | |
if(Date.now() - start < 10000) { | |
return setImmediate(log) | |
} | |
setInterval(function() { | |
console.log(process.memoryUsage()) | |
}, 1000) | |
} | |
log() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment