process.memoryUsage()

process.memoryUsage()

Returns an object describing the memory usage of the Node.js process measured in bytes.

1
2
3
const util = require('util');
 
console.log(util.inspect(process.memoryUsage()));

This will generate:

1
2
3
{ rss: 4935680,
  heapTotal: 1826816,
  heapUsed: 650472 }

heapTotal and heapUsed refer to V8's memory usage.

doc_Nodejs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.