Index: runtime/vm/scavenger.h |
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h |
index 954919ef9be2a5085c994595d4ef35da0528097c..8dffd45c06b80f3711cadbe7eefb95406afd05bd 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 |
+ // garabge to give the scavenger a chance to stablize at the new capacity. |
danunez
2017/08/21 18:36:19
garabge ==> garbage
rmacnak
2017/08/22 22:08:45
Done.
|
+ 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. |