In nodejs v8 module, there's a function called getHeapStatistics which return an object that contains information about memory usage:
{ total_heap_size: 221540352, total_heap_size_executable: 5242880, total_physical_size: 221540352, total_available_size: 1286110104, used_heap_size: 189179192, heap_size_limit: 1501560832, malloced_memory: 16384, peak_malloced_memory: 1325112, does_zap_garbage: 0 }
What's the meaning of each field?
V8 is Google's open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.
The V8 engine is what powers Node. js and it is an open-source engine on which even Chrome works. It parses and runs your JavaScript inside a Node environment.
libuv is a multi-platform C library that provides support for asynchronous I/O based on event loops. It supports epoll(4) , kqueue(2) , Windows IOCP, and Solaris event ports. It is primarily designed for use in Node. js but it is also used by other software projects.
Some good explanation from gc-heap-stats package:
From Node.JS docs:
Self descriptive:
There's V8 API documentation directly generated from the sources, but the details of HeapStatistics are not explained.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With