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

Unified Diff: runtime/vm/pages.cc

Issue 2790673004: DartVM: Fix rounding error causing linear instead of geometric heap growth (Closed)
Patch Set: Remove inadvertent Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 9768bc5f2510fad9045046e9a9564144c5968753..7ba704bf4215c637070e6ad219d277a5dcaffcd7 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -1249,12 +1249,13 @@ void PageSpaceController::EvaluateGarbageCollection(SpaceUsage before,
min = local_grow_heap + 1;
}
}
+ local_grow_heap = (max + min) / 2;
grow_heap_ = local_grow_heap;
ASSERT(grow_heap_ >= 0);
// If we are going to grow by heap_grow_max_ then ensure that we
// will be growing the heap at least by the growth ratio heuristics.
- if ((grow_heap_ == heap_growth_max_) && (grow_ratio > grow_heap_)) {
- grow_heap_ = grow_ratio;
+ if (grow_heap_ >= heap_growth_max_) {
+ grow_heap_ = Utils::Maximum(grow_ratio, grow_heap_);
}
}
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698