[GC] Change behavior when reaching external allocation limit
With the recent changes to the incremental marking API we can now kick off incremental marking while respecting callback flags. Performance neutral for smoothness.image_decoding_cases on N9 (read: does not crash) as long as we synchronously process phantom callbacks (kGCCallbackFlagForced). OORT single run: "marksweep": { "count": 5, "pause_min": 7.5, "pause_max": 158.8, "pause_avg": 97.52000000000001, "pause_gt_10ms": 4 } --- vs --- "marksweep": { "count": 5, "pause_min": 16.2, "pause_max": 22.1, "pause_avg": 19.32, "pause_gt_10ms": 5 } The number of actual full GCs varies. The improvement manifests in reduced maximum and average pauses. BUG=chromium:515795 LOG=N Review URL: https://codereview.chromium.org/1271253002 Cr-Commit-Position: refs/heads/master@{#30028}
This commit is contained in:
parent
5e52e66591
commit
1cb27bce67
16
src/api.cc
16
src/api.cc
@ -6884,8 +6884,20 @@ Local<Integer> v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) {
|
||||
|
||||
|
||||
void Isolate::CollectAllGarbage(const char* gc_reason) {
|
||||
reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
|
||||
i::Heap::kNoGCFlags, gc_reason, v8::kGCCallbackFlagForced);
|
||||
i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
|
||||
if (heap->incremental_marking()->IsStopped()) {
|
||||
heap->StartIncrementalMarking(i::Heap::kNoGCFlags, kGCCallbackFlagForced,
|
||||
gc_reason);
|
||||
}
|
||||
// TODO(mlippautz): Compute the time slice for incremental marking based on
|
||||
// memory pressure.
|
||||
double deadline = heap->MonotonicallyIncreasingTimeInMs() +
|
||||
i::FLAG_external_allocation_limit_incremental_time;
|
||||
heap->AdvanceIncrementalMarking(0, deadline,
|
||||
i::IncrementalMarking::StepActions(
|
||||
i::IncrementalMarking::GC_VIA_STACK_GUARD,
|
||||
i::IncrementalMarking::FORCE_MARKING,
|
||||
i::IncrementalMarking::FORCE_COMPLETION));
|
||||
}
|
||||
|
||||
|
||||
|
@ -810,6 +810,10 @@ DEFINE_BOOL(manual_evacuation_candidates_selection, false,
|
||||
"Test mode only flag. It allows an unit test to select evacuation "
|
||||
"candidates pages (requires --stress_compaction).")
|
||||
|
||||
// api.cc
|
||||
DEFINE_INT(external_allocation_limit_incremental_time, 1,
|
||||
"Time spent in incremental marking steps (in ms) once the external "
|
||||
"allocation limit is reached")
|
||||
|
||||
//
|
||||
// Dev shell flags
|
||||
|
Loading…
Reference in New Issue
Block a user