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

Unified Diff: src/heap/heap.h

Issue 2565173004: [heap] Special handling for small heaps in eager finalization of (Closed)
Patch Set: fix test Created 4 years 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 | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 4d408b6e46cdb02213a494673edd7a78bf0c0a10..3c4057373906527ea89e862069d868f57b63932a 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1827,11 +1827,15 @@ class Heap {
// performace reasons. If the overshoot is too large then we are more
// eager to finalize incremental marking.
inline bool AllocationLimitOvershotByLargeMargin() {
+ // This guards against too eager finalization in small heaps.
+ // The number is chosen based on v8.browsing_mobile on Nexus 7v2.
+ size_t kMarginForSmallHeaps = 32u * MB;
if (old_generation_allocation_limit_ >= PromotedTotalSize()) return false;
uint64_t overshoot = PromotedTotalSize() - old_generation_allocation_limit_;
- // Overshoot margin is 50% of allocation limit or half-way to the max heap.
+ // Overshoot margin is 50% of allocation limit or half-way to the max heap
+ // with special handling of small heaps.
uint64_t margin =
- Min(old_generation_allocation_limit_ / 2,
+ Min(Max(old_generation_allocation_limit_ / 2, kMarginForSmallHeaps),
(max_old_generation_size_ - old_generation_allocation_limit_) / 2);
return overshoot >= margin;
}
« no previous file with comments | « no previous file | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698