Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 8c507d48978bf5aebd6a11eb4e5ebc1e81e3b3b3..56a7941d261b0b0debb42b37f60c42639ca1f167 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -5598,7 +5598,8 @@ void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size, |
// We set the old generation growing factor to 2 to grow the heap slower on |
// memory-constrained devices. |
- if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { |
+ if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice || |
+ FLAG_optimize_for_size) { |
factor = Min(factor, kMaxHeapGrowingFactorMemoryConstrained); |
} |