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

Unified Diff: src/heap.cc

Issue 290133004: Print promotion rate and semi-space copy rate in --trace-gc-nvp. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 5d338b2122374a163e083aca1453c7c135bc4c0b..b4f5667b996360c09a1a62f11a6ee63f298b0360 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -97,10 +97,13 @@ Heap::Heap()
gc_safe_size_of_old_object_(NULL),
total_regexp_code_generated_(0),
tracer_(NULL),
- young_survivors_after_last_gc_(0),
high_survival_rate_period_length_(0),
low_survival_rate_period_length_(0),
survival_rate_(0),
+ promoted_objects_size_(0),
+ promotion_rate_(0),
+ semi_space_copied_object_size_(0),
+ semi_space_copied_rate_(0),
previous_survival_rate_trend_(Heap::STABLE),
survival_rate_trend_(Heap::STABLE),
max_gc_pause_(0.0),
@@ -421,6 +424,10 @@ void Heap::GarbageCollectionPrologue() {
#endif
}
+ // Reset GC statistics.
+ promoted_objects_size_ = 0;
+ semi_space_copied_object_size_ = 0;
+
UpdateMaximumCommitted();
#ifdef DEBUG
@@ -1005,9 +1012,15 @@ void Heap::ClearNormalizedMapCaches() {
void Heap::UpdateSurvivalRateTrend(int start_new_space_size) {
if (start_new_space_size == 0) return;
- double survival_rate =
- (static_cast<double>(young_survivors_after_last_gc_) * 100) /
- start_new_space_size;
+ promotion_rate_ =
+ (static_cast<double>(promoted_objects_size_) /
+ static_cast<double>(start_new_space_size) * 100);
+
+ semi_space_copied_rate_ =
+ (static_cast<double>(semi_space_copied_object_size_) /
+ static_cast<double>(start_new_space_size) * 100);
+
+ double survival_rate = promotion_rate_ + semi_space_copied_rate_;
if (survival_rate > kYoungSurvivalRateHighThreshold) {
high_survival_rate_period_length_++;
@@ -2056,7 +2069,7 @@ class ScavengingVisitor : public StaticVisitorBase {
}
}
- heap->tracer()->increment_promoted_objects_size(object_size);
+ heap->IncrementPromotedObjectsSize(object_size);
return;
}
}
@@ -2075,6 +2088,7 @@ class ScavengingVisitor : public StaticVisitorBase {
// buffer.
*slot = target;
MigrateObject(heap, object, target, object_size);
+ heap->IncrementSemiSpaceCopiedObjectSize(object_size);
return;
}
@@ -6028,7 +6042,6 @@ GCTracer::GCTracer(Heap* heap,
full_gc_count_(0),
allocated_since_last_gc_(0),
spent_in_mutator_(0),
- promoted_objects_size_(0),
nodes_died_in_new_space_(0),
nodes_copied_in_new_space_(0),
nodes_promoted_(0),
@@ -6175,11 +6188,15 @@ GCTracer::~GCTracer() {
PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize(heap_));
PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_);
- PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_);
+ PrintF("promoted=%" V8_PTR_PREFIX "d ", heap_->promoted_objects_size_);
+ PrintF("semi_space_copied=%" V8_PTR_PREFIX "d ",
+ heap_->semi_space_copied_object_size_);
PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_);
PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_);
PrintF("nodes_promoted=%d ", nodes_promoted_);
- PrintF("survived=%.1f%% ", heap_->survival_rate_);
+ PrintF("survival_rate=%.1f%% ", heap_->survival_rate_);
+ PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_);
+ PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_);
if (collector_ == SCAVENGER) {
PrintF("stepscount=%d ", steps_count_since_last_gc_);
« no previous file with comments | « src/heap.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698