Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 18103c38facadd18e084efd0945276a2489316b5..99d40fef537b403fdb0455780c61ead448e9249c 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -5021,7 +5021,7 @@ bool Heap::ConfigureHeap(int max_semi_space_size, |
if (max_semi_space_size_ > reserved_semispace_size_) { |
max_semi_space_size_ = reserved_semispace_size_; |
if (FLAG_trace_gc) { |
- PrintPID("Max semispace size cannot be more than %dkbytes\n", |
+ PrintPID("Max semi-space size cannot be more than %d kbytes\n", |
reserved_semispace_size_ >> 10); |
} |
} |
@@ -5041,6 +5041,20 @@ bool Heap::ConfigureHeap(int max_semi_space_size, |
// for containment. |
max_semi_space_size_ = RoundUpToPowerOf2(max_semi_space_size_); |
reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_); |
+ |
+ if (FLAG_min_semi_space_size > 0) { |
+ int initial_semispace_size = FLAG_min_semi_space_size * MB; |
+ if (initial_semispace_size > max_semi_space_size_) { |
+ initial_semispace_size_ = max_semi_space_size_; |
+ if (FLAG_trace_gc) { |
+ PrintPID("Min semi-space size cannot be more than the maximum" |
+ "semi-space size of %d MB\n", max_semi_space_size_); |
+ } |
+ } else { |
+ initial_semispace_size_ = initial_semispace_size; |
+ } |
+ } |
+ |
initial_semispace_size_ = Min(initial_semispace_size_, max_semi_space_size_); |
// The external allocation limit should be below 256 MB on all architectures |