Index: src/heap/heap.h |
diff --git a/src/heap/heap.h b/src/heap/heap.h |
index 5c276e9581c5fa2aac11a33db53cd7dd96a444b5..da6442a02ce4bd34f8902043520f5fbad66af0e0 100644 |
--- a/src/heap/heap.h |
+++ b/src/heap/heap.h |
@@ -1129,8 +1129,8 @@ 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); |
// Indicates whether inline bump-pointer allocation has been disabled. |
bool inline_allocation_disabled() { return inline_allocation_disabled_; } |
@@ -1244,7 +1244,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) { |
+ PrintF("Next GC will be full: We are at %" V8_PTR_PREFIX |
Hannes Payer (out of office)
2015/03/25 14:30:06
... likely to be full
Erik Corry Chromium.org
2015/03/25 15:16:06
Done.
|
+ "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) { |
+ PrintF("Next GC will be full: We are at %" V8_PTR_PREFIX |
Hannes Payer (out of office)
2015/03/25 14:30:06
... likely to be full
Erik Corry Chromium.org
2015/03/25 15:16:06
Done.
|
+ "dMbytes committed out of %" V8_PTR_PREFIX "dMbytes\n", |
+ CommittedOldGenerationMemory() >> 20, |
+ old_generation_committed_memory_limit_ >> 20); |
+ } |
+ return true; |
+ } |
return false; |
} |
@@ -1635,9 +1654,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 +2094,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); |