| 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 <inttypes.h> | 7 #include <inttypes.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 heap_statistics.total_heap_size() - | 157 heap_statistics.total_heap_size() - |
| 158 heap_statistics.total_physical_size()); | 158 heap_statistics.total_physical_size()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 // Dump statistics about malloced memory. | 161 // Dump statistics about malloced memory. |
| 162 std::string malloc_name = dump_base_name + "/malloc"; | 162 std::string malloc_name = dump_base_name + "/malloc"; |
| 163 auto* malloc_dump = process_memory_dump->CreateAllocatorDump(malloc_name); | 163 auto* malloc_dump = process_memory_dump->CreateAllocatorDump(malloc_name); |
| 164 malloc_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 164 malloc_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 165 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 165 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 166 heap_statistics.malloced_memory()); | 166 heap_statistics.malloced_memory()); |
| 167 malloc_dump->AddScalar("peak_size", |
| 168 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 169 heap_statistics.peak_malloced_memory()); |
| 167 const char* system_allocator_name = | 170 const char* system_allocator_name = |
| 168 base::trace_event::MemoryDumpManager::GetInstance() | 171 base::trace_event::MemoryDumpManager::GetInstance() |
| 169 ->system_allocator_pool_name(); | 172 ->system_allocator_pool_name(); |
| 170 if (system_allocator_name) { | 173 if (system_allocator_name) { |
| 171 process_memory_dump->AddSuballocation(malloc_dump->guid(), | 174 process_memory_dump->AddSuballocation(malloc_dump->guid(), |
| 172 system_allocator_name); | 175 system_allocator_name); |
| 173 } | 176 } |
| 174 | 177 |
| 175 // Add an empty row for the heap_spaces. This is to keep the shape of the | 178 // Add an empty row for the heap_spaces. This is to keep the shape of the |
| 176 // dump stable, whether code stats are enabled or not. | 179 // dump stable, whether code stats are enabled or not. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 process_memory_dump->AddOwnershipEdge( | 229 process_memory_dump->AddOwnershipEdge( |
| 227 process_memory_dump->CreateAllocatorDump(object_name_prefix)->guid(), | 230 process_memory_dump->CreateAllocatorDump(object_name_prefix)->guid(), |
| 228 heap_spaces_dump->guid()); | 231 heap_spaces_dump->guid()); |
| 229 } | 232 } |
| 230 | 233 |
| 231 // Dump statistics related to code and bytecode if requested. | 234 // Dump statistics related to code and bytecode if requested. |
| 232 DumpCodeStatistics(heap_spaces_dump, isolate_holder_); | 235 DumpCodeStatistics(heap_spaces_dump, isolate_holder_); |
| 233 } | 236 } |
| 234 | 237 |
| 235 } // namespace gin | 238 } // namespace gin |
| OLD | NEW |