| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index 38e4971f4aa55933194c8a4053f3b07a9185d438..9a99f9bcd73edca7d99cc828b4bc139936a4a097 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -96,6 +96,7 @@ Heap::Heap()
|
| #ifdef DEBUG
|
| allocation_timeout_(0),
|
| #endif // DEBUG
|
| + flush_eagerly_(false),
|
| old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit),
|
| old_gen_exhausted_(false),
|
| inline_allocation_disabled_(false),
|
| @@ -736,7 +737,7 @@ void Heap::CollectAllGarbage(int flags, const char* gc_reason,
|
| }
|
|
|
|
|
| -void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
|
| +void Heap::CollectAllAvailableGarbage(const char* gc_reason, int max_attempts) {
|
| // Since we are ignoring the return value, the exact choice of space does
|
| // not matter, so long as we do not specify NEW_SPACE, which would not
|
| // cause a full GC.
|
| @@ -756,9 +757,9 @@ void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
|
| mark_compact_collector()->SetFlags(kMakeHeapIterableMask |
|
| kReduceMemoryFootprintMask);
|
| isolate_->compilation_cache()->Clear();
|
| - const int kMaxNumberOfAttempts = 7;
|
| const int kMinNumberOfAttempts = 2;
|
| - for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
|
| + FlushEagerly flush_eagerly_scope(this);
|
| + for (int attempt = 0; attempt < max_attempts; attempt++) {
|
| if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL) &&
|
| attempt + 1 >= kMinNumberOfAttempts) {
|
| break;
|
|
|