| Index: src/heap/heap.h
|
| diff --git a/src/heap/heap.h b/src/heap/heap.h
|
| index 5c276e9581c5fa2aac11a33db53cd7dd96a444b5..f338f488116cb6fd390e2ebf5ed0cda694732040 100644
|
| --- a/src/heap/heap.h
|
| +++ b/src/heap/heap.h
|
| @@ -1097,6 +1097,8 @@ class Heap {
|
|
|
| static const int kInitalOldGenerationLimitFactor = 2;
|
|
|
| + static const intptr_t kDefaultMaxOldGenSize = 700ul * (kPointerSize / 4) * MB;
|
| +
|
| #if V8_OS_ANDROID
|
| // Don't apply pointer multiplier on Android since it has no swap space and
|
| // should instead adapt it's heap size based on available physical memory.
|
| @@ -1129,8 +1131,9 @@ class Heap {
|
| static const int kMaxExecutableSizeHugeMemoryDevice =
|
| 256 * kPointerMultiplier;
|
|
|
| - intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size,
|
| - int freed_global_handles);
|
| + void SetOldGenerationAllocationLimit(intptr_t old_gen_size,
|
| + int freed_global_handles,
|
| + bool weak_callbacks_completed);
|
|
|
| // Indicates whether inline bump-pointer allocation has been disabled.
|
| bool inline_allocation_disabled() { return inline_allocation_disabled_; }
|
| @@ -1244,7 +1247,26 @@ class Heap {
|
| intptr_t adjusted_allocation_limit =
|
| old_generation_allocation_limit_ - new_space_.Capacity();
|
|
|
| - if (PromotedTotalSize() >= adjusted_allocation_limit) return true;
|
| + if (PromotedTotalSize() >= adjusted_allocation_limit) {
|
| + if (FLAG_trace_gc_verbose) {
|
| + PrintF("Next GC likely to be full: We are at %" V8_PTR_PREFIX
|
| + "dMbytes out of %" V8_PTR_PREFIX "dMbytes\n",
|
| + PromotedTotalSize() >> 20,
|
| + old_generation_allocation_limit_ >> 20);
|
| + }
|
| + return true;
|
| + }
|
| +
|
| + if (CommittedOldGenerationMemory() >=
|
| + old_generation_committed_memory_limit_) {
|
| + if (FLAG_trace_gc_verbose) {
|
| + PrintF("Next GC likely to be full: We are at %" V8_PTR_PREFIX
|
| + "dMbytes committed out of %" V8_PTR_PREFIX "dMbytes\n",
|
| + CommittedOldGenerationMemory() >> 20,
|
| + old_generation_committed_memory_limit_ >> 20);
|
| + }
|
| + return true;
|
| + }
|
|
|
| return false;
|
| }
|
| @@ -1635,9 +1657,14 @@ class Heap {
|
| // Limit that triggers a global GC on the next (normally caused) GC. This
|
| // is checked when we have already decided to do a GC to help determine
|
| // which collector to invoke, before expanding a paged space in the old
|
| - // generation and on every allocation in large object space.
|
| + // generation and on every allocation in large object space. This only
|
| + // measures objects, so it may be underreporting if we have fragmentation.
|
| intptr_t old_generation_allocation_limit_;
|
|
|
| + // As above, but counts pages, not objects, so is more likely to trigger
|
| + // when we have fragmentation.
|
| + intptr_t old_generation_committed_memory_limit_;
|
| +
|
| // Indicates that an allocation has failed in the old generation since the
|
| // last GC.
|
| bool old_gen_exhausted_;
|
| @@ -2070,8 +2097,6 @@ class Heap {
|
| double idle_time_in_ms, size_t size_of_objects,
|
| size_t mark_compact_speed_in_bytes_per_ms);
|
|
|
| - bool WorthActivatingIncrementalMarking();
|
| -
|
| void ClearObjectStats(bool clear_last_time_stats = false);
|
|
|
| inline void UpdateAllocationsHash(HeapObject* object);
|
|
|