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

Unified Diff: src/heap/heap.cc

Issue 1180203003: Dampen old generation allocation limit after scavenge if allocation rate is low. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 6 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/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index ec48b324479b6bd90b66fd5af7c728f03e5ac804..32c3e6e0d1eab203138189c05aa2e98420727af7 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1283,16 +1283,18 @@ bool Heap::PerformGarbageCollection(
// Update relocatables.
Relocatable::PostGarbageCollectionProcessing(isolate_);
+ double gc_speed = tracer()->CombinedMarkCompactSpeedInBytesPerMillisecond();
+ double mutator_speed = static_cast<double>(
+ tracer()
+ ->CurrentOldGenerationAllocationThroughputInBytesPerMillisecond());
+ intptr_t old_gen_size = PromotedSpaceSizeOfObjects();
if (collector == MARK_COMPACTOR) {
// Register the amount of external allocated memory.
amount_of_external_allocated_memory_at_last_global_gc_ =
amount_of_external_allocated_memory_;
- double gc_speed = tracer()->CombinedMarkCompactSpeedInBytesPerMillisecond();
- double mutator_speed = static_cast<double>(
- tracer()
- ->CurrentOldGenerationAllocationThroughputInBytesPerMillisecond());
- intptr_t old_gen_size = PromotedSpaceSizeOfObjects();
SetOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed);
+ } else if (HasLowYoungGenerationAllocationRate()) {
+ DampenOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed);
}
{
@@ -5575,6 +5577,24 @@ void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
}
+void Heap::DampenOldGenerationAllocationLimit(intptr_t old_gen_size,
+ double gc_speed,
+ double mutator_speed) {
+ double factor = HeapGrowingFactor(gc_speed, mutator_speed);
+ intptr_t limit = CalculateOldGenerationAllocationLimit(factor, old_gen_size);
+ if (limit < old_generation_allocation_limit_) {
+ if (FLAG_trace_gc_verbose) {
+ PrintIsolate(isolate_, "Dampen: old size: %" V8_PTR_PREFIX
+ "d KB, old limit: %" V8_PTR_PREFIX "d KB, \n",
+ "new limit: %" V8_PTR_PREFIX "d KB (%.1f)\n",
+ old_gen_size / KB, old_generation_allocation_limit_ / KB,
+ limit / KB, factor);
+ }
+ old_generation_allocation_limit_ = limit;
+ }
+}
+
+
void Heap::EnableInlineAllocation() {
if (!inline_allocation_disabled_) return;
inline_allocation_disabled_ = false;
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698