Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Unified Diff: gin/v8_isolate_memory_dump_provider.cc

Issue 1129403003: Adding total available size of heap in v8 isolate memory dump provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/v8_isolate_memory_dump_provider.cc
diff --git a/gin/v8_isolate_memory_dump_provider.cc b/gin/v8_isolate_memory_dump_provider.cc
index 4530879a7969233c103baa1acad96a0b749d7720..fd58efdb15c98e1a86cb4337d23de914a162bead 100644
--- a/gin/v8_isolate_memory_dump_provider.cc
+++ b/gin/v8_isolate_memory_dump_provider.cc
@@ -53,6 +53,7 @@ void V8IsolateMemoryDumpProvider::DumpMemoryStatistics(
size_t known_spaces_used_size = 0;
size_t known_spaces_size = 0;
+ size_t known_spaces_available_size = 0;
size_t number_of_spaces = isolate_holder_->isolate()->NumberOfHeapSpaces();
for (size_t space = 0; space < number_of_spaces; space++) {
v8::HeapSpaceStatistics space_statistics;
@@ -60,9 +61,11 @@ void V8IsolateMemoryDumpProvider::DumpMemoryStatistics(
space);
const size_t space_size = space_statistics.space_size();
const size_t space_used_size = space_statistics.space_used_size();
+ size_t space_available_size = space_statistics.space_available_size();
known_spaces_size += space_size;
known_spaces_used_size += space_used_size;
+ known_spaces_available_size += space_available_size;
std::string allocator_name =
base::StringPrintf("%s/%s_%p/%s/%s", kRootDumpName, kIsolateDumpName,
@@ -74,14 +77,12 @@ void V8IsolateMemoryDumpProvider::DumpMemoryStatistics(
base::trace_event::MemoryAllocatorDump::kNameOuterSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes, space_size);
- // TODO(ssid): Fix crbug.com/481504 to get the objects count of live objects
- // after the last GC.
space_dump->AddScalar(
base::trace_event::MemoryAllocatorDump::kNameInnerSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes, space_used_size);
space_dump->AddScalar(kAvailableSizeAttribute,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
- space_statistics.space_available_size());
+ space_available_size);
}
// Compute the rest of the memory, not accounted by the spaces above.
std::string allocator_name = base::StringPrintf(
@@ -102,7 +103,8 @@ void V8IsolateMemoryDumpProvider::DumpMemoryStatistics(
// heap.
other_spaces_dump->AddScalar(
kAvailableSizeAttribute,
- base::trace_event::MemoryAllocatorDump::kUnitsBytes, 0);
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ heap_statistics.total_available_size() - known_spaces_available_size);
}
} // namespace gin
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698