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 2d261eb9ecc1d26f5cf8d6a88f9dfc238e71a572..ab1b152eaa67ed9a7e184f31668b85b998137a38 100644 |
--- a/gin/v8_isolate_memory_dump_provider.cc |
+++ b/gin/v8_isolate_memory_dump_provider.cc |
@@ -35,14 +35,15 @@ bool V8IsolateMemoryDumpProvider::OnMemoryDump( |
if (isolate_holder_->access_mode() == IsolateHolder::kUseLocker) { |
v8::Locker locked(isolate_holder_->isolate()); |
- DumpHeapStatistics(process_memory_dump); |
+ DumpHeapStatistics(args, process_memory_dump); |
} else { |
- DumpHeapStatistics(process_memory_dump); |
+ DumpHeapStatistics(args, process_memory_dump); |
} |
return true; |
} |
void V8IsolateMemoryDumpProvider::DumpHeapStatistics( |
+ const base::trace_event::MemoryDumpArgs& args, |
base::trace_event::ProcessMemoryDump* process_memory_dump) { |
std::string dump_base_name = |
base::StringPrintf("v8/isolate_%p", isolate_holder_->isolate()); |
@@ -93,6 +94,11 @@ void V8IsolateMemoryDumpProvider::DumpHeapStatistics( |
base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
heap_statistics.used_heap_size() - known_spaces_used_size); |
+ // If light dump is requested, then object statistics are not dumped |
+ if (args.level_of_detail == |
+ base::trace_event::MemoryDumpArgs::LevelOfDetail::LOW) |
+ return; |
+ |
// Dump statistics of the heap's live objects from last GC. |
std::string object_name_prefix = dump_base_name + "/heap_objects"; |
bool did_dump_object_stats = false; |