Map heap maps at a lower address.
We now map the heap mmaps at a lower address in case the app needs
larger continuous address space.
Bug: 16502380
(cherry picked from commit 18bacb60e09fa8aa20ae0a1d7a4a8968d4913fb0)
Change-Id: I66447f853e439448c72923e2d1c657c94c5f1543
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index e857b25..42c7cca 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -258,6 +258,8 @@
MemMap::MapAnonymous("non moving space", requested_alloc_space_begin,
non_moving_space_capacity, PROT_READ | PROT_WRITE, true, &error_str));
CHECK(non_moving_space_mem_map != nullptr) << error_str;
+ // Try to reserve virtual memory at a lower address if we have a separate non moving space.
+ request_begin = reinterpret_cast<byte*>(0x1000000);
}
// Attempt to create 2 mem maps at or after the requested begin.
main_mem_map_1.reset(MapAnonymousPreferredAddress(kMemMapSpaceName[0], request_begin, capacity_,