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

Unified Diff: src/heap/heap.cc

Issue 2931393002: [heap] Reland use larger marking steps during external allocation pressure (Closed)
Patch Set: fix Created 3 years, 6 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: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 8b1494d2807a1d400a7b80c981a2a5220f33453d..cc12f7709311856679857576e632133faa2bb484 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -952,15 +952,13 @@ void Heap::ReportExternalMemoryPressure() {
}
} else {
// Incremental marking is turned on an has already been started.
- const double pressure =
- static_cast<double>(external_memory_ -
- external_memory_at_last_mark_compact_ -
- kExternalAllocationSoftLimit) /
- external_memory_hard_limit();
- DCHECK_GE(1, pressure);
- const double kMaxStepSizeOnExternalLimit = 25;
- const double deadline = MonotonicallyIncreasingTimeInMs() +
- pressure * kMaxStepSizeOnExternalLimit;
+ const double kMinStepSize = 5;
+ const double kMaxStepSize = 10;
+ const double ms_step =
+ Min(kMaxStepSize,
+ Max(kMinStepSize, static_cast<double>(external_memory_) /
+ external_memory_limit_ * kMinStepSize));
+ const double deadline = MonotonicallyIncreasingTimeInMs() + ms_step;
incremental_marking()->AdvanceIncrementalMarking(
deadline, IncrementalMarking::GC_VIA_STACK_GUARD,
IncrementalMarking::FORCE_COMPLETION, StepOrigin::kV8);
« 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