node:v8
The built-in Node.js module that exposes V8 internals, such as heap statistics, heap snapshots and serialisation.
In more detail
v8.getHeapStatistics() reports totals including heap_size_limit, and v8.getHeapSpaceStatistics() breaks usage down by heap space. v8.writeHeapSnapshot() saves a snapshot file.
Related terms
- V8 — Google's open-source JavaScript engine, used by Chrome and Node.js to parse, compile and run JavaScript.
- heap space — One of the separate regions V8 divides its heap into, such as new space for young objects and old space for long-lived ones.
- heap snapshot — A file recording every object in a JavaScript heap at one moment and how they refer to each other, used to find memory leaks.
Taught in
- Diagnostic Profiling: CPU Profiler & Heap Snapshots — Node.js Internals & Backend Services