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

Unified Diff: runtime/vm/pages.cc

Issue 231983004: Fix used vs. capacity growth computation mismatch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
===================================================================
--- runtime/vm/pages.cc (revision 34902)
+++ runtime/vm/pages.cc (working copy)
@@ -13,7 +13,7 @@
namespace dart {
-DEFINE_FLAG(int, heap_growth_space_ratio, 10,
+DEFINE_FLAG(int, heap_growth_space_ratio, 20,
"The desired maximum percentage of free space after GC");
DEFINE_FLAG(int, heap_growth_time_ratio, 3,
"The desired maximum percentage of time spent in GC");
@@ -692,15 +692,16 @@
if (enough_free_space && enough_free_time) {
grow_heap_ = 0;
} else {
- intptr_t growth_target = static_cast<intptr_t>(
+ intptr_t used_target = static_cast<intptr_t>(
after_total_in_words / desired_utilization_);
- intptr_t growth_in_words = Utils::RoundUp(
- growth_target - after_total_in_words,
- PageSpace::kPageSizeInWords);
- int growth_in_pages =
- growth_in_words / PageSpace::kPageSizeInWords;
- grow_heap_ = Utils::Maximum(growth_in_pages, heap_growth_rate_);
- heap->RecordData(PageSpace::kPageGrowth, growth_in_pages);
+ intptr_t capacity_growth_in_words =
+ Utils::RoundUp(Utils::Maximum(static_cast<intptr_t>(0),
+ used_target - after.capacity_in_words),
+ PageSpace::kPageSizeInWords);
+ int capacity_growth_in_pages =
+ capacity_growth_in_words / PageSpace::kPageSizeInWords;
+ grow_heap_ = Utils::Maximum(capacity_growth_in_pages, heap_growth_rate_);
+ heap->RecordData(PageSpace::kPageGrowth, capacity_growth_in_pages);
}
heap->RecordData(PageSpace::kGarbageRatio, collected_garbage_ratio);
heap->RecordData(PageSpace::kGCTimeFraction,
« 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