Commit a025371c authored by hpayer@chromium.org's avatar hpayer@chromium.org

Simplifying GC heuristics, deleted old generation limit factor.

Review URL: https://codereview.chromium.org/15114003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0099fdeb
...@@ -120,7 +120,6 @@ Heap::Heap() ...@@ -120,7 +120,6 @@ Heap::Heap()
new_space_high_promotion_mode_active_(false), new_space_high_promotion_mode_active_(false),
old_gen_promotion_limit_(kMinimumPromotionLimit), old_gen_promotion_limit_(kMinimumPromotionLimit),
old_gen_allocation_limit_(kMinimumAllocationLimit), old_gen_allocation_limit_(kMinimumAllocationLimit),
old_gen_limit_factor_(1),
size_of_old_gen_at_last_old_space_gc_(0), size_of_old_gen_at_last_old_space_gc_(0),
external_allocation_limit_(0), external_allocation_limit_(0),
amount_of_external_allocated_memory_(0), amount_of_external_allocated_memory_(0),
...@@ -912,26 +911,11 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, ...@@ -912,26 +911,11 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector,
// Perform mark-sweep with optional compaction. // Perform mark-sweep with optional compaction.
MarkCompact(tracer); MarkCompact(tracer);
sweep_generation_++; sweep_generation_++;
bool high_survival_rate_during_scavenges = IsHighSurvivalRate() &&
IsStableOrIncreasingSurvivalTrend();
UpdateSurvivalRateTrend(start_new_space_size); UpdateSurvivalRateTrend(start_new_space_size);
size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects(); size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects();
if (high_survival_rate_during_scavenges &&
IsStableOrIncreasingSurvivalTrend()) {
// Stable high survival rates of young objects both during partial and
// full collection indicate that mutator is either building or modifying
// a structure with a long lifetime.
// In this case we aggressively raise old generation memory limits to
// postpone subsequent mark-sweep collection and thus trade memory
// space for the mutation speed.
old_gen_limit_factor_ = 2;
} else {
old_gen_limit_factor_ = 1;
}
old_gen_promotion_limit_ = old_gen_promotion_limit_ =
OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_); OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_);
old_gen_allocation_limit_ = old_gen_allocation_limit_ =
...@@ -5895,7 +5879,6 @@ void Heap::ReportHeapStatistics(const char* title) { ...@@ -5895,7 +5879,6 @@ void Heap::ReportHeapStatistics(const char* title) {
old_gen_promotion_limit_); old_gen_promotion_limit_);
PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n", PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n",
old_gen_allocation_limit_); old_gen_allocation_limit_);
PrintF("old_gen_limit_factor_ %d\n", old_gen_limit_factor_);
PrintF("\n"); PrintF("\n");
PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles(isolate_)); PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles(isolate_));
......
...@@ -1571,7 +1571,6 @@ class Heap { ...@@ -1571,7 +1571,6 @@ class Heap {
intptr_t limit = intptr_t limit =
Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit); Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit);
limit += new_space_.Capacity(); limit += new_space_.Capacity();
limit *= old_gen_limit_factor_;
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
return Min(limit, halfway_to_the_max); return Min(limit, halfway_to_the_max);
} }
...@@ -1582,7 +1581,6 @@ class Heap { ...@@ -1582,7 +1581,6 @@ class Heap {
intptr_t limit = intptr_t limit =
Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit); Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit);
limit += new_space_.Capacity(); limit += new_space_.Capacity();
limit *= old_gen_limit_factor_;
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
return Min(limit, halfway_to_the_max); return Min(limit, halfway_to_the_max);
} }
...@@ -2002,10 +2000,6 @@ class Heap { ...@@ -2002,10 +2000,6 @@ class Heap {
// every allocation in large object space. // every allocation in large object space.
intptr_t old_gen_allocation_limit_; intptr_t old_gen_allocation_limit_;
// Sometimes the heuristics dictate that those limits are increased. This
// variable records that fact.
int old_gen_limit_factor_;
// Used to adjust the limits that control the timing of the next GC. // Used to adjust the limits that control the timing of the next GC.
intptr_t size_of_old_gen_at_last_old_space_gc_; intptr_t size_of_old_gen_at_last_old_space_gc_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment