Give the JIT its own arena pool to avoid lock contentions.
Sharing it with the verifier and the class loader is not ideal,
especially at startup time.
bug:27398183
bug:23128949
Change-Id: I1b91663a13f6c5b33ad3b4be780d93eb7fe445b4
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index eb5455a..47ef214 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -316,6 +316,7 @@
linear_alloc_.reset();
low_4gb_arena_pool_.reset();
arena_pool_.reset();
+ jit_arena_pool_.reset();
MemMap::Shutdown();
ATRACE_END();
@@ -1019,10 +1020,13 @@
// Use MemMap arena pool for jit, malloc otherwise. Malloc arenas are faster to allocate but
// can't be trimmed as easily.
const bool use_malloc = IsAotCompiler();
- arena_pool_.reset(new ArenaPool(use_malloc, false));
+ arena_pool_.reset(new ArenaPool(use_malloc, /* low_4gb */ false));
+ jit_arena_pool_.reset(
+ new ArenaPool(/* use_malloc */ false, /* low_4gb */ false, "CompilerMetadata"));
+
if (IsAotCompiler() && Is64BitInstructionSet(kRuntimeISA)) {
// 4gb, no malloc. Explanation in header.
- low_4gb_arena_pool_.reset(new ArenaPool(false, true));
+ low_4gb_arena_pool_.reset(new ArenaPool(/* use_malloc */ false, /* low_4gb */ true));
}
linear_alloc_.reset(CreateLinearAlloc());