Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index 8710a5f54b00057d0a093c210200aea2f7bac1a0..8982a2953273abbe35993b57ab63ee43d42ae0d7 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -398,7 +398,7 @@ bool MemoryAllocator::CanFreeMemoryChunk(MemoryChunk* chunk) { |
// We cannot free memory chunks in new space while the sweeper is running |
// since a sweeper thread might be stuck right before trying to lock the |
// corresponding page. |
- return !chunk->InNewSpace() || (mc == nullptr) || |
+ return !chunk->InNewSpace() || (mc == nullptr) || !FLAG_concurrent_sweeping || |
mc->sweeper().IsSweepingCompleted(); |
} |