Skip to content

Instantly share code, notes, and snippets.

@geek
Created June 24, 2013 17:34
Show Gist options
  • Save geek/5851912 to your computer and use it in GitHub Desktop.
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
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