From 9b34b244ecddd8a35c922ed87bc3df0ca4db0282 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 9 Mar 2015 11:30:17 -0700 Subject: Trim arenas for JIT Moved arena pool into the runtime. Added arena trimming to arena pool. When called, this madvises the used memory. Changed the JIT compiler to trim arenas after compilation. Changed the arena mmap name to dalvik-LinearAlloc. Native PSS before: 80353 kB: Native 80775 kB: Native 78116 kB: Native After: 73357 kB: Native 70181 kB: Native 70306 kB: Native Bug: 17950037 Bug: 17643507 Bug: 19264997 Change-Id: I63e7a898fd6e909c2c677fa57b5917a7b1398930 --- compiler/driver/compiler_driver.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index d1291fa719..78dd6cc29e 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -2412,8 +2412,9 @@ bool CompilerDriver::SkipCompilation(const std::string& method_name) { std::string CompilerDriver::GetMemoryUsageString(bool extended) const { std::ostringstream oss; - const ArenaPool* arena_pool = GetArenaPool(); - gc::Heap* heap = Runtime::Current()->GetHeap(); + Runtime* const runtime = Runtime::Current(); + const ArenaPool* arena_pool = runtime->GetArenaPool(); + gc::Heap* const heap = runtime->GetHeap(); oss << "arena alloc=" << PrettySize(arena_pool->GetBytesAllocated()); oss << " java alloc=" << PrettySize(heap->GetBytesAllocated()); #ifdef HAVE_MALLOC_H -- cgit v1.2.3-59-g8ed1b