Created
April 16, 2013 22:42
-
-
Save geek/5400287 to your computer and use it in GitHub Desktop.
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'); | |
setInterval(function () { | |
ChildProcess.exec('echo', function () { | |
console.log(Math.round(process.memoryUsage().rss / (1024 * 1024)) + 'M used'); | |
}); | |
}, 100); | |
/* | |
Output: | |
12M used | |
12M used | |
12M used | |
12M used | |
12M used | |
12M used | |
12M used | |
12M used | |
12M used | |
13M used | |
13M used | |
13M used | |
13M used | |
13M used | |
13M used | |
13M used | |
14M used | |
14M used | |
14M used | |
14M used | |
14M used | |
14M used | |
14M used | |
14M used | |
14M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
15M used | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment