Created
June 24, 2013 17:34
-
-
Save geek/5851912 to your computer and use it in GitHub Desktop.
Here is an example of code that grows the memory for a while then eventually stabilizes
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
var ChildProcess = require('child_process'); | |
var maxMem = Math.round(process.memoryUsage().rss / (1024 * 1024)) * 2; | |
setInterval(function () { | |
ChildProcess.exec('echo', function () { | |
var mem = Math.round(process.memoryUsage().rss / (1024 * 1024)); | |
console.log(mem + 'M used'); | |
}); | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment