Skip to content

Instantly share code, notes, and snippets.

@improved-broccoli
Created November 2, 2015 15:35
Show Gist options
  • Select an option

  • Save improved-broccoli/4dc2b56ee7877f50ed8f to your computer and use it in GitHub Desktop.

Select an option

Save improved-broccoli/4dc2b56ee7877f50ed8f to your computer and use it in GitHub Desktop.
Print memory usage in nodejs scripts
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