Index: src/heap.cc |
=================================================================== |
--- src/heap.cc (revision 10282) |
+++ src/heap.cc (working copy) |
@@ -580,6 +580,7 @@ |
PagedSpace* map_space = Heap::map_space(); |
PagedSpace* cell_space = Heap::cell_space(); |
LargeObjectSpace* lo_space = Heap::lo_space(); |
+ bool one_gc_has_been_performed = false; |
bool gc_performed = true; |
while (gc_performed) { |
gc_performed = false; |
@@ -615,10 +616,17 @@ |
// allocation in the other spaces. |
large_object_size += cell_space_size + map_space_size + code_space_size + |
data_space_size + pointer_space_size; |
- if (!(lo_space->ReserveSpace(large_object_size))) { |
+ |
+ // If we already did one GC in order to make space in old space, there is |
+ // no sense in doing another one. We will attempt to force through the |
+ // large object space allocation, which comes directly from the OS, |
+ // regardless of any soft limit. |
+ if (!one_gc_has_been_performed && |
+ !(lo_space->ReserveSpace(large_object_size))) { |
Heap::CollectGarbage(LO_SPACE); |
gc_performed = true; |
} |
+ if (gc_performed) one_gc_has_been_performed = true; |
Vyacheslav Egorov (Chromium)
2011/12/21 13:22:12
scavenge will not free any space in LO.
gc_perfor
|
} |
} |
@@ -5301,8 +5309,8 @@ |
// The new space size must be a power of two to support single-bit testing |
// for containment. |
- max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_); |
- reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_); |
+ max_semispace_size_ = SignedRoundUpToPowerOf2(max_semispace_size_); |
Vyacheslav Egorov (Chromium)
2011/12/21 13:22:12
what's the point of these fields being signed? loo
|
+ reserved_semispace_size_ = SignedRoundUpToPowerOf2(reserved_semispace_size_); |
initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_); |
external_allocation_limit_ = 10 * max_semispace_size_; |