Created
November 2, 2015 15:35
-
-
Save improved-broccoli/4dc2b56ee7877f50ed8f to your computer and use it in GitHub Desktop.
Print memory usage in nodejs scripts
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 lodash = require('lodash'); | |
| function printMemUsage() { | |
| console.log(lodash.values(lodash.mapValues(process.memoryUsage(), function (v) { | |
| return (v/(Math.pow(1024, 2))).toFixed(0); | |
| })).join()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment