| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gin/v8_isolate_memory_dump_provider.h" | 5 #include "gin/v8_isolate_memory_dump_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 heap_statistics.total_heap_size() - | 153 heap_statistics.total_heap_size() - |
| 154 heap_statistics.total_physical_size()); | 154 heap_statistics.total_physical_size()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Dump statistics about malloced memory. | 157 // Dump statistics about malloced memory. |
| 158 std::string malloc_name = dump_base_name + "/malloc"; | 158 std::string malloc_name = dump_base_name + "/malloc"; |
| 159 auto malloc_dump = process_memory_dump->CreateAllocatorDump(malloc_name); | 159 auto malloc_dump = process_memory_dump->CreateAllocatorDump(malloc_name); |
| 160 malloc_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 160 malloc_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 161 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 161 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 162 heap_statistics.malloced_memory()); | 162 heap_statistics.malloced_memory()); |
| 163 malloc_dump->AddScalar("peak_size", |
| 164 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 165 heap_statistics.malloced_peak_memory()); |
| 163 const char* system_allocator_name = | 166 const char* system_allocator_name = |
| 164 base::trace_event::MemoryDumpManager::GetInstance() | 167 base::trace_event::MemoryDumpManager::GetInstance() |
| 165 ->system_allocator_pool_name(); | 168 ->system_allocator_pool_name(); |
| 166 if (system_allocator_name) { | 169 if (system_allocator_name) { |
| 167 process_memory_dump->AddSuballocation(malloc_dump->guid(), | 170 process_memory_dump->AddSuballocation(malloc_dump->guid(), |
| 168 system_allocator_name); | 171 system_allocator_name); |
| 169 } | 172 } |
| 170 | 173 |
| 171 // Add an empty row for the heap_spaces. This is to keep the shape of the | 174 // Add an empty row for the heap_spaces. This is to keep the shape of the |
| 172 // dump stable, whether code stats are enabled or not. | 175 // dump stable, whether code stats are enabled or not. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 process_memory_dump->AddOwnershipEdge( | 225 process_memory_dump->AddOwnershipEdge( |
| 223 process_memory_dump->CreateAllocatorDump(object_name_prefix)->guid(), | 226 process_memory_dump->CreateAllocatorDump(object_name_prefix)->guid(), |
| 224 heap_spaces_dump->guid()); | 227 heap_spaces_dump->guid()); |
| 225 } | 228 } |
| 226 | 229 |
| 227 // Dump statistics related to code and bytecode if requested. | 230 // Dump statistics related to code and bytecode if requested. |
| 228 DumpCodeStatistics(heap_spaces_dump, isolate_holder_); | 231 DumpCodeStatistics(heap_spaces_dump, isolate_holder_); |
| 229 } | 232 } |
| 230 | 233 |
| 231 } // namespace gin | 234 } // namespace gin |
| OLD | NEW |