Commit dfa7e3f7 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[api] GetHeapStatistics: Only report backing stores as external memory

Whether backing stores are on V8's heap or not is opaque to JavaScript.
This is not true for other external memory such as DOM which is why only
backingstores are considered as on heap.

Bug: chromium:914304
Change-Id: Idfeb9815daeee239a6a5b95077421e555bfe5fda
Reviewed-on: https://chromium-review.googlesource.com/c/1454726Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59389}
parent f71dd204
......@@ -8405,7 +8405,7 @@ void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
heap_statistics->malloced_memory_ =
isolate->allocator()->GetCurrentMemoryUsage() +
isolate->wasm_engine()->allocator()->GetCurrentMemoryUsage();
heap_statistics->external_memory_ = isolate->heap()->external_memory();
heap_statistics->external_memory_ = isolate->heap()->backing_store_bytes();
heap_statistics->peak_malloced_memory_ =
isolate->allocator()->GetMaxMemoryUsage() +
isolate->wasm_engine()->allocator()->GetMaxMemoryUsage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment