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

Unified Diff: runtime/vm/scavenger.h

Issue 3003063002: Fix the new generation growth criterion so it is not mislead into performing two growths in a row. (Closed)
Patch Set: speeling Created 3 years, 4 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 | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.h
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index e250de2b80d526209627a06769ee7a7b78a9dfb3..160354a1413bab283b6c01ea77e9aaecb7bc1151 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -82,9 +82,11 @@ class ScavengeStats {
promoted_in_words_(promoted_in_words) {}
// Of all data before scavenge, what fraction was found to be garbage?
- double GarbageFraction() const {
+ // If this scavenge included growth, assume the extra capacity would become
+ // garbage to give the scavenger a chance to stablize at the new capacity.
+ double ExpectedGarbageFraction() const {
intptr_t survived = after_.used_in_words + promoted_in_words_;
- return 1.0 - (survived / static_cast<double>(before_.used_in_words));
+ return 1.0 - (survived / static_cast<double>(after_.capacity_in_words));
}
// Fraction of promotion candidates that survived and was thereby promoted.
« no previous file with comments | « no previous file | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698