diff --git a/runtime/vm/heap/heap.cc b/runtime/vm/heap/heap.cc index 9475b4f28ed..0c943fadebe 100644 --- a/runtime/vm/heap/heap.cc +++ b/runtime/vm/heap/heap.cc @@ -565,7 +565,12 @@ void Heap::CheckConcurrentMarking(Thread* thread, GCReason reason) { switch (phase) { case PageSpace::kMarking: - // TODO(rmacnak): Have this thread help with marking. + // TODO(rmacnak): Make the allocator of a large page mark size equals to + // the large page? + COMPILE_ASSERT(kOldPageSize == 512 * KB); + COMPILE_ASSERT(kNewPageSize == 512 * KB); + old_space_.IncrementalMarkWithSizeBudget(512 * KB); + return; case PageSpace::kSweepingLarge: case PageSpace::kSweepingRegular: return; // Busy. diff --git a/runtime/vm/heap/pages.cc b/runtime/vm/heap/pages.cc index e7f1933ffee..dbd960ac5f1 100644 --- a/runtime/vm/heap/pages.cc +++ b/runtime/vm/heap/pages.cc @@ -1674,19 +1674,17 @@ void PageSpaceController::RecordUpdate(SpaceUsage before, after.CombinedUsedInWords() + (kOldPageSizeInWords * growth_in_pages); #if defined(TARGET_ARCH_IA32) - // No concurrent marking. - soft_gc_threshold_in_words_ = threshold; - hard_gc_threshold_in_words_ = threshold; + bool concurrent_mark = false; #else - // Start concurrent marking when old-space has less than half of new-space - // available or less than 5% available. - // Note that heap_ can be null in some unit tests. - const intptr_t new_space = - heap_ == nullptr ? 0 : heap_->new_space()->CapacityInWords(); - const intptr_t headroom = Utils::Maximum(new_space / 2, threshold / 20); - soft_gc_threshold_in_words_ = threshold; - hard_gc_threshold_in_words_ = threshold + headroom; + bool concurrent_mark = FLAG_concurrent_mark && (FLAG_marker_tasks != 0); #endif + if (concurrent_mark) { + soft_gc_threshold_in_words_ = threshold; + hard_gc_threshold_in_words_ = kIntptrMax / kWordSize; + } else { + soft_gc_threshold_in_words_ = kIntptrMax / kWordSize; + hard_gc_threshold_in_words_ = threshold; + } // Set a tight idle threshold. idle_gc_threshold_in_words_ =