process.memoryUsage()

A Node.js function that reports the process's memory use in bytes: rss, heapTotal, heapUsed, external and arrayBuffers.

In more detail

heapUsed is memory taken by live JavaScript objects, heapTotal is what V8 has reserved for its heap, and external counts native memory such as Buffer contents. Logging it at intervals is a quick way to spot a memory leak.

Related terms

Taught in

References