Commit 2178bbaf authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Adjust upper limit in ComputeMaxSemiSpaceSize.

This ensures that 2GB devices get 512K initial semi-space.

Bug: chromium:735649
TBR: mlippautz@chromium.org
Change-Id: I864c9dfa7cd3ea9040fa56d81d6bf1187c1cf776
Reviewed-on: https://chromium-review.googlesource.com/608129Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47246}
parent edc4ae14
......@@ -1306,7 +1306,7 @@ class Heap {
static size_t ComputeMaxSemiSpaceSize(uint64_t physical_memory) {
const uint64_t min_physical_memory = 512 * MB;
const uint64_t max_physical_memory = 2 * static_cast<uint64_t>(GB);
const uint64_t max_physical_memory = 3 * static_cast<uint64_t>(GB);
uint64_t capped_physical_memory =
Max(Min(physical_memory, max_physical_memory), min_physical_memory);
......
......@@ -68,8 +68,8 @@ TEST(Heap, SemiSpaceSize) {
const size_t pm = i::Heap::kPointerMultiplier;
ASSERT_EQ(1u * pm * MB / 2, i::Heap::ComputeMaxSemiSpaceSize(0u) * KB);
ASSERT_EQ(1u * pm * MB / 2, i::Heap::ComputeMaxSemiSpaceSize(512u * MB) * KB);
ASSERT_EQ(3u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(1024u * MB) * KB);
ASSERT_EQ(8u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(2024u * MB) * KB);
ASSERT_EQ(2u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(1024u * MB) * KB);
ASSERT_EQ(5u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(2024u * MB) * KB);
ASSERT_EQ(8u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(4095u * MB) * KB);
}
......
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