diff options
| -rw-r--r-- | runtime/jit/jit_code_cache.cc | 9 | ||||
| -rw-r--r-- | runtime/jit/jit_memory_region.cc | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc index 3e1e108e18..b5c32793a3 100644 --- a/runtime/jit/jit_code_cache.cc +++ b/runtime/jit/jit_code_cache.cc @@ -964,15 +964,6 @@ uint8_t* JitCodeCache::ReserveData(Thread* self, result = region->AllocateData(size); } - if (result == nullptr) { - // Retry. - GarbageCollectCache(self); - ScopedThreadSuspension sts(self, kSuspended); - MutexLock mu(self, *Locks::jit_lock_); - WaitForPotentialCollectionToComplete(self); - result = region->AllocateData(size); - } - MutexLock mu(self, *Locks::jit_lock_); histogram_stack_map_memory_use_.AddValue(size); if (size > kStackMapSizeLogThreshold) { diff --git a/runtime/jit/jit_memory_region.cc b/runtime/jit/jit_memory_region.cc index c23172c101..39353cacf2 100644 --- a/runtime/jit/jit_memory_region.cc +++ b/runtime/jit/jit_memory_region.cc @@ -270,6 +270,11 @@ bool JitMemoryRegion::Initialize(size_t initial_capacity, /* locked= */ false); CHECK(data_mspace_ != nullptr) << "create_mspace_with_base (data) failed"; + // Allow mspace to use the full data capacity. + // It will still only use as litle memory as possible and ask for MoreCore as needed. + CHECK(IsAlignedParam(data_capacity, kPageSize)); + mspace_set_footprint_limit(data_mspace_, data_capacity); + // Initialize the code heap. MemMap* code_heap = nullptr; if (non_exec_pages_.IsValid()) { @@ -298,7 +303,6 @@ void JitMemoryRegion::SetFootprintLimit(size_t new_footprint) { size_t data_space_footprint = new_footprint / kCodeAndDataCapacityDivider; DCHECK(IsAlignedParam(data_space_footprint, kPageSize)); DCHECK_EQ(data_space_footprint * kCodeAndDataCapacityDivider, new_footprint); - mspace_set_footprint_limit(data_mspace_, data_space_footprint); if (HasCodeMapping()) { ScopedCodeCacheWrite scc(*this); mspace_set_footprint_limit(exec_mspace_, new_footprint - data_space_footprint); |