Node: Requesting documentation of v8.getHeapStatistics() properties

Created on 22 Apr 2020  路  3Comments  路  Source: nodejs/node

https://github.com/nodejs/node/issues/32206 mentions that none of the properties returned by v8.getHeapStatistics() are properly documented.

I'm currently relying on an answer I found on stackoverflow (https://stackoverflow.com/questions/41541843/nodejs-v8-getheapstatistics-method) but there should be some official documentation about the individual values returned in the documentation.

doc

Most helpful comment

Pull request welcome.

All 3 comments

Pull request welcome.

Some of the values are also available by process.memoryUsage() and therefore already described at https://nodejs.org/api/process.html#process_process_memoryusage:

  • v8.getHeapStatistics().total_heap_size -> process.memoryUsage().heapTotal
  • v8.getHeapStatistics().used_heap_size -> process.memoryUsage().heapUsed
  • v8.getHeapStatistics().external_memory -> process.memoryUsage().external

See: https://github.com/nodejs/node/blob/60c4c2b6c557efbb2f8f3a3de147baf987931d41/src/node_process_methods.cc#L190-L219 and https://github.com/nodejs/node/blob/abe6a2e3d1c268f5bebbf05864f2588c6f4858b5/lib/internal/process/per_thread.js#L149-L159

Maybe we should mention that those are the same.

this is fully documented now, here. Closing, pls re-open if my understanding is wrong

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vsemozhetbyt picture vsemozhetbyt  路  3Comments

danielstaleiny picture danielstaleiny  路  3Comments

addaleax picture addaleax  路  3Comments

loretoparisi picture loretoparisi  路  3Comments

srl295 picture srl295  路  3Comments