diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2015-03-17 16:01:11 -0700 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2015-03-17 16:01:11 -0700 |
commit | 3dbf23412481c4da51f0ebe32bec5d300c36834b (patch) | |
tree | a900023a52b868f7776f6c92ced3201cc691fb8a /runtime/gc | |
parent | cadf090da2dc91a3d6b842324e85f12ea6fef2ef (diff) | |
download | art-3dbf23412481c4da51f0ebe32bec5d300c36834b.zip art-3dbf23412481c4da51f0ebe32bec5d300c36834b.tar.gz art-3dbf23412481c4da51f0ebe32bec5d300c36834b.tar.bz2 |
Fix oat_file_assistant_test32 flaky failures with GSS collector.
Bug: 19800031
Change-Id: I5146fa4e6a79bad94762102a50956c31251dcd2a
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/heap.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 0cad11f..dff8f4d 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -291,10 +291,18 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max // Try to reserve virtual memory at a lower address if we have a separate non moving space. request_begin = reinterpret_cast<uint8_t*>(300 * MB); } + // Attempt to create 2 mem maps at or after the requested begin. if (foreground_collector_type_ != kCollectorTypeCC) { - // Attempt to create 2 mem maps at or after the requested begin. - main_mem_map_1.reset(MapAnonymousPreferredAddress(kMemMapSpaceName[0], request_begin, capacity_, - &error_str)); + if (separate_non_moving_space) { + main_mem_map_1.reset(MapAnonymousPreferredAddress(kMemMapSpaceName[0], request_begin, + capacity_, &error_str)); + } else { + // If no separate non-moving space, the main space must come + // right after the image space to avoid a gap. + main_mem_map_1.reset(MemMap::MapAnonymous(kMemMapSpaceName[0], request_begin, capacity_, + PROT_READ | PROT_WRITE, true, false, + &error_str)); + } CHECK(main_mem_map_1.get() != nullptr) << error_str; } if (support_homogeneous_space_compaction || |