}
-GCTracer::SurvivalEvent::SurvivalEvent(double survival_rate) {
- survival_rate_ = survival_rate;
+GCTracer::PromotionEvent::PromotionEvent(double promotion_ratio) {
+ promotion_ratio_ = promotion_ratio;
}
}
-void GCTracer::AddSurvivalRate(double survival_rate) {
- survival_events_.push_front(SurvivalEvent(survival_rate));
+void GCTracer::AddPromotionRatio(double promotion_ratio) {
+ promotion_events_.push_front(PromotionEvent(promotion_ratio));
}
PrintF("nodes_copied_in_new=%d ", heap_->nodes_copied_in_new_space_);
PrintF("nodes_promoted=%d ", heap_->nodes_promoted_);
PrintF("promotion_ratio=%.1f%% ", heap_->promotion_ratio_);
+ PrintF("average_promotion_ratio=%.1f%% ", AveragePromotionRatio());
PrintF("promotion_rate=%.1f%% ", heap_->promotion_rate_);
PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_);
- PrintF("average_survival_rate%.1f%% ", AverageSurvivalRate());
PrintF("new_space_allocation_throughput=%" V8_PTR_PREFIX "d ",
NewSpaceAllocationThroughputInBytesPerMillisecond());
PrintF("context_disposal_rate=%.1f ", ContextDisposalRateInMilliseconds());
}
-double GCTracer::AverageSurvivalRate() const {
- if (survival_events_.size() == 0) return 0.0;
+double GCTracer::AveragePromotionRatio() const {
+ if (promotion_events_.size() == 0) return 0.0;
double sum_of_rates = 0.0;
- SurvivalEventBuffer::const_iterator iter = survival_events_.begin();
- while (iter != survival_events_.end()) {
- sum_of_rates += iter->survival_rate_;
+ PromotionEventBuffer::const_iterator iter = promotion_events_.begin();
+ while (iter != promotion_events_.end()) {
+ sum_of_rates += iter->promotion_ratio_;
++iter;
}
- return sum_of_rates / static_cast<double>(survival_events_.size());
+ return sum_of_rates / static_cast<double>(promotion_events_.size());
}
bool GCTracer::SurvivalEventsRecorded() const {
- return survival_events_.size() > 0;
+ return promotion_events_.size() > 0;
}
-void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); }
+void GCTracer::ResetSurvivalEvents() { promotion_events_.reset(); }
}
} // namespace v8::internal
};
- class SurvivalEvent {
+ class PromotionEvent {
public:
// Default constructor leaves the event uninitialized.
- SurvivalEvent() {}
+ PromotionEvent() {}
- explicit SurvivalEvent(double survival_rate);
+ explicit PromotionEvent(double promotion_ratio);
- double survival_rate_;
+ double promotion_ratio_;
};
typedef RingBuffer<ContextDisposalEvent, kRingBufferMaxSize>
ContextDisposalEventBuffer;
- typedef RingBuffer<SurvivalEvent, kRingBufferMaxSize> SurvivalEventBuffer;
+ typedef RingBuffer<PromotionEvent, kRingBufferMaxSize> PromotionEventBuffer;
explicit GCTracer(Heap* heap);
void AddContextDisposalTime(double time);
- void AddSurvivalRate(double survival_rate);
+ void AddPromotionRatio(double promotion_ratio);
// Log an incremental marking step.
void AddIncrementalMarkingStep(double duration, intptr_t bytes);
// Returns 0 if no events have been recorded.
double ContextDisposalRateInMilliseconds() const;
- // Computes the average survival rate based on the last recorded survival
+ // Computes the average promotion ratio based on the last recorded promotion
// events.
// Returns 0 if no events have been recorded.
- double AverageSurvivalRate() const;
+ double AveragePromotionRatio() const;
// Returns true if at least one survival event was recorded.
bool SurvivalEventsRecorded() const;
// RingBuffer for context disposal events.
ContextDisposalEventBuffer context_disposal_events_;
- // RingBuffer for survival events.
- SurvivalEventBuffer survival_events_;
+ // RingBuffer for promotion events.
+ PromotionEventBuffer promotion_events_;
// Cumulative number of incremental marking steps since creation of tracer.
int cumulative_incremental_marking_steps_;
initial_semispace_size_(Page::kPageSize),
target_semispace_size_(Page::kPageSize),
max_old_generation_size_(700ul * (kPointerSize / 4) * MB),
- initial_old_generation_size_(max_old_generation_size_ / 2),
+ initial_old_generation_size_(max_old_generation_size_),
old_generation_size_configured_(false),
max_executable_size_(256ul * (kPointerSize / 4) * MB),
// Variables set based on semispace_size_ and old_generation_size_ in
promotion_ratio_ = (static_cast<double>(promoted_objects_size_) /
static_cast<double>(start_new_space_size) * 100);
+ if (gc_count_ > 1) tracer()->AddPromotionRatio(promotion_ratio_);
+
if (previous_semi_space_copied_object_size_ > 0) {
promotion_rate_ =
(static_cast<double>(promoted_objects_size_) /
static_cast<double>(start_new_space_size) * 100);
double survival_rate = promotion_ratio_ + semi_space_copied_rate_;
- tracer()->AddSurvivalRate(survival_rate);
-
if (survival_rate > kYoungSurvivalRateHighThreshold) {
high_survival_rate_period_length_++;
} else {
Max(kMinimumOldGenerationAllocationLimit,
static_cast<intptr_t>(
static_cast<double>(initial_old_generation_size_) *
- (tracer()->AverageSurvivalRate() / 100)));
+ (tracer()->AveragePromotionRatio() / 100)));
}
}