Skip to content

Instantly share code, notes, and snippets.

@tnguven
Last active January 14, 2019 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnguven/2d2391fc39655fa75be35e12600a74e1 to your computer and use it in GitHub Desktop.
Save tnguven/2d2391fc39655fa75be35e12600a74e1 to your computer and use it in GitHub Desktop.
process.memoryUsage() template
const byteToMb = byte => (byte / 1024) / 1024;
const { rss, heapTotal, heapUsed, external } = process.memoryUsage()
console.log({
rss: `${byteToMb(rss)}mb`,
heapTotal: `${byteToMb(heapTotal)}mb`,
heapUsed: `${byteToMb(heapUsed)}mb`,
external: `${byteToMb(external)}mb`
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment