Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index ff978cf3b7f5f198165fcd01e5c82ca6b1ed3059..3b77714affc7a1ab07c4b6c77e74f613dedac62c 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -6513,7 +6513,8 @@ static intptr_t CountTotalHolesSize() { |
GCTracer::GCTracer(Heap* heap) |
: start_time_(0.0), |
- start_size_(0), |
+ start_object_size_(0), |
+ start_memory_size_(0), |
gc_count_(0), |
full_gc_count_(0), |
allocated_since_last_gc_(0), |
@@ -6522,7 +6523,8 @@ GCTracer::GCTracer(Heap* heap) |
heap_(heap) { |
if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; |
start_time_ = OS::TimeCurrentMillis(); |
- start_size_ = heap_->SizeOfObjects(); |
+ start_object_size_ = heap_->SizeOfObjects(); |
+ start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); |
for (int i = 0; i < Scope::kNumberOfScopes; i++) { |
scopes_[i] = 0; |
@@ -6572,10 +6574,15 @@ GCTracer::~GCTracer() { |
if (!FLAG_trace_gc_nvp) { |
int external_time = static_cast<int>(scopes_[Scope::EXTERNAL]); |
- PrintF("%s %.1f -> %.1f MB, ", |
+ double end_memory_size_mb = |
+ static_cast<double>(heap_->isolate()->memory_allocator()->Size()) / MB; |
+ |
+ PrintF("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", |
CollectorString(), |
- static_cast<double>(start_size_) / MB, |
- SizeOfHeapObjects()); |
+ static_cast<double>(start_object_size_) / MB, |
+ static_cast<double>(start_memory_size_) / MB, |
+ SizeOfHeapObjects(), |
+ end_memory_size_mb); |
if (external_time > 0) PrintF("%d / ", external_time); |
PrintF("%d ms", time); |
@@ -6629,7 +6636,7 @@ GCTracer::~GCTracer() { |
PrintF("misc_compaction=%d ", |
static_cast<int>(scopes_[Scope::MC_UPDATE_MISC_POINTERS])); |
- PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_size_); |
+ PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); |
PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects()); |
PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", |
in_free_list_or_wasted_before_gc_); |