Lower limit for external allocation and improve tracing.

R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/16896012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15210 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a527f451
......@@ -550,7 +550,7 @@ intptr_t Heap::AdjustAmountOfExternalAllocatedMemory(
if (amount >= 0) {
amount_of_external_allocated_memory_ = amount;
} else {
// Give up and reset the counters in case of an overflow.
// Give up and reset the counters in case of an underflow.
amount_of_external_allocated_memory_ = 0;
amount_of_external_allocated_memory_at_last_global_gc_ = 0;
}
......@@ -558,8 +558,11 @@ intptr_t Heap::AdjustAmountOfExternalAllocatedMemory(
if (FLAG_trace_external_memory) {
PrintPID("%8.0f ms: ", isolate()->time_millis_since_init());
PrintF("Adjust amount of external memory: delta=%6" V8_PTR_PREFIX "d KB, "
" amount=%6" V8_PTR_PREFIX "d KB, isolate=0x%08" V8PRIxPTR ".\n",
change_in_bytes / 1024, amount_of_external_allocated_memory_ / 1024,
"amount=%6" V8_PTR_PREFIX "d KB, since_gc=%6" V8_PTR_PREFIX "d KB, "
"isolate=0x%08" V8PRIxPTR ".\n",
change_in_bytes / KB,
amount_of_external_allocated_memory_ / KB,
PromotedExternalMemorySize() / KB,
reinterpret_cast<intptr_t>(isolate()));
}
ASSERT(amount_of_external_allocated_memory_ >= 0);
......
......@@ -6645,7 +6645,12 @@ bool Heap::ConfigureHeap(int max_semispace_size,
max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_);
reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_);
initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_);
external_allocation_limit_ = 16 * max_semispace_size_;
// The external allocation limit should be below 256 MB on all architectures
// to avoid unnecessary low memory notifications, as that is the threshold
// for some embedders.
external_allocation_limit_ = 12 * max_semispace_size_;
ASSERT(external_allocation_limit_ <= 256 * MB);
// The old generation is paged and needs at least one page for each space.
int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment