Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 76f34b263a3861c04fcbdd493f016daaa69d9a54..392ef4d62f3d22aab1eff7b38b2736e75d1917b0 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -79,6 +79,7 @@ Heap::Heap() |
// ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
// Will be 4 * reserved_semispace_size_ to ensure that young |
// generation can be aligned to its size. |
+ maximum_committed_(0), |
survived_since_last_expansion_(0), |
sweep_generation_(0), |
always_allocate_scope_depth_(0), |
@@ -232,6 +233,16 @@ intptr_t Heap::CommittedMemoryExecutable() { |
} |
+void Heap::UpdateMaximumCommitted() { |
+ if (!HasBeenSetUp()) return; |
+ |
+ intptr_t current_committed_memory = CommittedMemory(); |
+ if (current_committed_memory > maximum_committed_) { |
+ maximum_committed_ = current_committed_memory; |
+ } |
+} |
+ |
+ |
intptr_t Heap::Available() { |
if (!HasBeenSetUp()) return 0; |
@@ -563,6 +574,9 @@ void Heap::GarbageCollectionEpilogue() { |
property_cell_space()->CommittedMemory() / KB)); |
isolate_->counters()->heap_sample_code_space_committed()->AddSample( |
static_cast<int>(code_space()->CommittedMemory() / KB)); |
+ |
+ isolate_->counters()->heap_sample_maximum_committed()->AddSample( |
+ static_cast<int>(MaximumCommittedMemory() / KB)); |
} |
#define UPDATE_COUNTERS_FOR_SPACE(space) \ |
@@ -6871,6 +6885,31 @@ void Heap::TearDown() { |
PrintF("\n\n"); |
} |
+ if (FLAG_print_max_heap_committed) { |
+ PrintF("\n"); |
+ PrintF("maximum_committed_by_heap=%" V8_PTR_PREFIX "d ", |
+ MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_new_space=%" V8_PTR_PREFIX "d ", |
+ new_space_.MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_old_pointer_space=%" V8_PTR_PREFIX "d ", |
+ old_data_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_old_data_space=%" V8_PTR_PREFIX "d ", |
+ old_pointer_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_old_data_space=%" V8_PTR_PREFIX "d ", |
+ old_pointer_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_code_space=%" V8_PTR_PREFIX "d ", |
+ code_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_map_space=%" V8_PTR_PREFIX "d ", |
+ map_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_cell_space=%" V8_PTR_PREFIX "d ", |
+ cell_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_property_space=%" V8_PTR_PREFIX "d ", |
+ property_cell_space_->MaximumCommittedMemory()); |
+ PrintF("maximum_committed_by_lo_space=%" V8_PTR_PREFIX "d ", |
+ lo_space_->MaximumCommittedMemory()); |
+ PrintF("\n\n"); |
+ } |
+ |
TearDownArrayBuffers(); |
isolate_->global_handles()->TearDown(); |