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

Side by Side Diff: src/api.cc

Issue 2153423002: Track peak Zone memory usage and report it via HeapStatistics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | src/base/accounting-allocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project 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 "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 5601 matching lines...) Expand 10 before | Expand all | Expand 10 after
5612 } 5612 }
5613 5613
5614 HeapStatistics::HeapStatistics() 5614 HeapStatistics::HeapStatistics()
5615 : total_heap_size_(0), 5615 : total_heap_size_(0),
5616 total_heap_size_executable_(0), 5616 total_heap_size_executable_(0),
5617 total_physical_size_(0), 5617 total_physical_size_(0),
5618 total_available_size_(0), 5618 total_available_size_(0),
5619 used_heap_size_(0), 5619 used_heap_size_(0),
5620 heap_size_limit_(0), 5620 heap_size_limit_(0),
5621 malloced_memory_(0), 5621 malloced_memory_(0),
5622 peak_malloced_memory_(0),
5622 does_zap_garbage_(0) {} 5623 does_zap_garbage_(0) {}
5623 5624
5624 HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0), 5625 HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0),
5625 space_size_(0), 5626 space_size_(0),
5626 space_used_size_(0), 5627 space_used_size_(0),
5627 space_available_size_(0), 5628 space_available_size_(0),
5628 physical_space_size_(0) { } 5629 physical_space_size_(0) { }
5629 5630
5630 5631
5631 HeapObjectStatistics::HeapObjectStatistics() 5632 HeapObjectStatistics::HeapObjectStatistics()
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after
7590 i::Heap* heap = isolate->heap(); 7591 i::Heap* heap = isolate->heap();
7591 heap_statistics->total_heap_size_ = heap->CommittedMemory(); 7592 heap_statistics->total_heap_size_ = heap->CommittedMemory();
7592 heap_statistics->total_heap_size_executable_ = 7593 heap_statistics->total_heap_size_executable_ =
7593 heap->CommittedMemoryExecutable(); 7594 heap->CommittedMemoryExecutable();
7594 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); 7595 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory();
7595 heap_statistics->total_available_size_ = heap->Available(); 7596 heap_statistics->total_available_size_ = heap->Available();
7596 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); 7597 heap_statistics->used_heap_size_ = heap->SizeOfObjects();
7597 heap_statistics->heap_size_limit_ = heap->MaxReserved(); 7598 heap_statistics->heap_size_limit_ = heap->MaxReserved();
7598 heap_statistics->malloced_memory_ = 7599 heap_statistics->malloced_memory_ =
7599 isolate->allocator()->GetCurrentMemoryUsage(); 7600 isolate->allocator()->GetCurrentMemoryUsage();
7601 heap_statistics->peak_malloced_memory_ =
7602 isolate->allocator()->GetMaxMemoryUsage();
7600 heap_statistics->does_zap_garbage_ = heap->ShouldZapGarbage(); 7603 heap_statistics->does_zap_garbage_ = heap->ShouldZapGarbage();
7601 } 7604 }
7602 7605
7603 7606
7604 size_t Isolate::NumberOfHeapSpaces() { 7607 size_t Isolate::NumberOfHeapSpaces() {
7605 return i::LAST_SPACE - i::FIRST_SPACE + 1; 7608 return i::LAST_SPACE - i::FIRST_SPACE + 1;
7606 } 7609 }
7607 7610
7608 7611
7609 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, 7612 bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics,
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
9041 Address callback_address = 9044 Address callback_address =
9042 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9045 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9043 VMState<EXTERNAL> state(isolate); 9046 VMState<EXTERNAL> state(isolate);
9044 ExternalCallbackScope call_scope(isolate, callback_address); 9047 ExternalCallbackScope call_scope(isolate, callback_address);
9045 callback(info); 9048 callback(info);
9046 } 9049 }
9047 9050
9048 9051
9049 } // namespace internal 9052 } // namespace internal
9050 } // namespace v8 9053 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/base/accounting-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698