From a5604a73d8d52219bcb97ff2934f81b67edc11af Mon Sep 17 00:00:00 2001 From: Rodrigo Bruno Date: Tue, 7 Aug 2018 15:18:50 +0200 Subject: [PATCH] src: use HeapStatistics to get external memory V8 is improving the way external memory is internally managed and how it is reported. External memory should now be retrieved using HeapStatistics. Refs: https://github.com/v8/node/pull/80 PR-URL: https://github.com/nodejs/node/pull/22754 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Ali Ijaz Sheikh Reviewed-By: Colin Ihrig --- src/node_process.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_process.cc b/src/node_process.cc index c223b482cf..51041c49ed 100644 --- a/src/node_process.cc +++ b/src/node_process.cc @@ -208,7 +208,7 @@ void MemoryUsage(const FunctionCallbackInfo& args) { fields[0] = rss; fields[1] = v8_heap_stats.total_heap_size(); fields[2] = v8_heap_stats.used_heap_size(); - fields[3] = isolate->AdjustAmountOfExternalAllocatedMemory(0); + fields[3] = v8_heap_stats.external_memory(); } // Most of the time, it's best to use `console.error` to write