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

Unified Diff: src/incremental-marking.cc

Issue 7737024: Speed up incremental marking if the heap size doubled (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 3 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/incremental-marking.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/incremental-marking.cc
===================================================================
--- src/incremental-marking.cc (revision 9070)
+++ src/incremental-marking.cc (working copy)
@@ -43,6 +43,8 @@
steps_count_(0),
steps_took_(0),
longest_step_(0.0),
+ old_generation_space_available_at_start_of_incremental_(0),
+ old_generation_space_used_at_start_of_incremental_(0),
steps_count_since_last_gc_(0),
steps_took_since_last_gc_(0),
should_hurry_(false),
@@ -583,7 +585,32 @@
steps_count_++;
steps_count_since_last_gc_++;
- if ((steps_count_ % kAllocationMarkingFactorSpeedupInterval) == 0) {
+ bool speed_up = false;
+
+ if (old_generation_space_available_at_start_of_incremental_ < 10 * MB ||
+ SpaceLeftInOldSpace() <
+ old_generation_space_available_at_start_of_incremental_ >> 1) {
+ // Half of the space that was available is gone while we were
+ // incrementally marking.
+ speed_up = true;
+ old_generation_space_available_at_start_of_incremental_ =
+ SpaceLeftInOldSpace();
+ }
+
+ if (heap_->PromotedTotalSize() >
+ old_generation_space_used_at_start_of_incremental_ << 1) {
+ // Size of old space doubled while we were incrementally marking.
+ speed_up = true;
+ old_generation_space_used_at_start_of_incremental_ =
+ heap_->PromotedTotalSize();
+ }
+
+ if ((steps_count_ % kAllocationMarkingFactorSpeedupInterval) == 0 &&
+ allocation_marking_factor_ < kMaxAllocationMarkingFactor) {
+ speed_up = true;
+ }
+
+ if (speed_up && 0) {
allocation_marking_factor_ += kAllocationMarkingFactorSpeedup;
allocation_marking_factor_ =
static_cast<int>(allocation_marking_factor_ * 1.3);
@@ -602,4 +629,23 @@
}
+void IncrementalMarking::ResetStepCounters() {
+ steps_count_ = 0;
+ steps_took_ = 0;
+ longest_step_ = 0.0;
+ old_generation_space_available_at_start_of_incremental_ =
+ SpaceLeftInOldSpace();
+ old_generation_space_used_at_start_of_incremental_ =
+ heap_->PromotedTotalSize();
+ steps_count_since_last_gc_ = 0;
+ steps_took_since_last_gc_ = 0;
+ bytes_rescanned_ = 0;
+ allocation_marking_factor_ = kInitialAllocationMarkingFactor;
+}
+
+
+int64_t IncrementalMarking::SpaceLeftInOldSpace() {
+ return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize();
+}
+
} } // namespace v8::internal
« no previous file with comments | « src/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698