mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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 <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
committed by
Michaël Zasso
parent
dca0300a86
commit
a5604a73d8
@@ -208,7 +208,7 @@ void MemoryUsage(const FunctionCallbackInfo<Value>& 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
|
||||
|
||||
Reference in New Issue
Block a user