diff options
| -rw-r--r-- | runtime/gc/heap.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index f99f361acc..6a91501238 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -407,9 +407,11 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max mark_compact_collector_ = new collector::MarkCompact(this); garbage_collectors_.push_back(mark_compact_collector_); } - if (GetImageSpace() != nullptr && non_moving_space_ != nullptr) { + if (GetImageSpace() != nullptr && non_moving_space_ != nullptr && + (is_zygote || separate_non_moving_space || foreground_collector_type_ == kCollectorTypeGSS)) { // Check that there's no gap between the image space and the non moving space so that the - // immune region won't break (eg. due to a large object allocated in the gap). + // immune region won't break (eg. due to a large object allocated in the gap). This is only + // required when we're the zygote or using GSS. bool no_gap = MemMap::CheckNoGaps(GetImageSpace()->GetMemMap(), non_moving_space_->GetMemMap()); if (!no_gap) { |