What is V8
V8 in Node.js
The Node.js V8 module represents to interfaces and event explicit to the rendition of V8. It gives techniques to get data about heap memory through v8.getHeapStatistics() and v8.getHeapSpaceStatistics() methods.
To utilize this module, you have to utilize require('v8').
Node.js v8.getHeapStatistics() Example
The v8.getHeapStatistics() technique returns statistics about heap , for example, complete store measure, utilized stack estimate, heap estimate limit, total accessible size etc.
Node.js v8.getHeapSpaceStatistics() Example
The v8.getHeapSpaceStatistics() returns statistics about heap space. It returns an array of 5 objects: new space, old space, code space, map space and large object space. Each object contains information about space name, space size, space used size, space available size and physical space size.