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

Unified Diff: src/heap/heap.cc

Issue 1269743002: Take into account freed global handles for heap growing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 f28d17a9b68fab830756085901e3308d53db4896..b4b019ef50d5481c6255a64cd56a19c4f6eebbe5 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1325,7 +1325,8 @@ bool Heap::PerformGarbageCollection(
// Register the amount of external allocated memory.
amount_of_external_allocated_memory_at_last_global_gc_ =
amount_of_external_allocated_memory_;
- SetOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed);
+ SetOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed,
+ freed_global_handles);
} else if (HasLowYoungGenerationAllocationRate() &&
old_generation_size_configured_) {
DampenOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed);
@@ -5653,7 +5654,11 @@ intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor,
void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
double gc_speed,
- double mutator_speed) {
+ double mutator_speed,
+ int freed_global_handles) {
+ const int kFreedGlobalHandlesThreshold = 700;
ulan 2015/07/30 13:58:32 These numbers are from the old heap growing strate
+ const double kMaxHeapGrowingFactorForManyFreedGlobalHandles = 1.3;
+
double factor = HeapGrowingFactor(gc_speed, mutator_speed);
if (FLAG_trace_gc_verbose) {
@@ -5671,6 +5676,10 @@ void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
factor = Min(factor, kMaxHeapGrowingFactorMemoryConstrained);
}
+ if (freed_global_handles >= kFreedGlobalHandlesThreshold) {
+ factor = Min(factor, kMaxHeapGrowingFactorForManyFreedGlobalHandles);
+ }
+
if (FLAG_stress_compaction ||
mark_compact_collector()->reduce_memory_footprint_) {
factor = kMinHeapGrowingFactor;
« 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