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

Unified Diff: src/heap/incremental-marking.cc

Issue 2520963004: [heap] Ensure quick progress of incremental marking near OOM. (Closed)
Patch Set: typo Created 4 years, 1 month 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 | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index 2fe52906255592175fe1afd020f2b15fa2577e21..d3e4b99981d16c60ebee697f22d0834f39e340f6 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -1069,6 +1069,13 @@ size_t IncrementalMarking::StepSizeToMakeProgress() {
// target step count are chosen based on benchmarks.
const int kRampUpIntervalMs = 300;
const size_t kTargetStepCount = 128;
+ const size_t kTargetStepCountAtOOM = 16;
+ size_t oom_slack = heap()->new_space()->Capacity() + 64 * MB;
+
+ if (heap()->IsCloseToOutOfMemory(oom_slack)) {
+ return heap()->PromotedSpaceSizeOfObjects() / kTargetStepCountAtOOM;
+ }
+
size_t step_size = Max(initial_old_generation_size_ / kTargetStepCount,
IncrementalMarking::kAllocatedThreshold);
double time_passed_ms =
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698