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

Unified Diff: runtime/vm/pages.cc

Issue 233473002: Limit shrinkage: allow growth by at least half the pages freed by GC. (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 34928)
+++ runtime/vm/pages.cc (working copy)
@@ -703,6 +703,11 @@
grow_heap_ = Utils::Maximum(capacity_growth_in_pages, heap_growth_rate_);
heap->RecordData(PageSpace::kPageGrowth, capacity_growth_in_pages);
}
+ // Limit shrinkage: allow growth by at least half the pages freed by GC.
+ intptr_t freed_pages =
+ (before.capacity_in_words - after.capacity_in_words) /
+ PageSpace::kPageSizeInWords;
+ grow_heap_ = Utils::Maximum(grow_heap_, freed_pages / 2);
heap->RecordData(PageSpace::kGarbageRatio, collected_garbage_ratio);
heap->RecordData(PageSpace::kGCTimeFraction,
garbage_collection_time_fraction);
« 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