From 69d310e0317e2fce97bf8c9c133c5c2c0332e61d Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 9 Oct 2017 14:12:23 +0100 Subject: Use ScopedArenaAllocator for building HGraph. Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 21.1MiB -> 20.2MiB BatteryStats.dumpLocked(): 42.0MiB -> 40.3MiB This is because all the memory previously used by the graph builder is reused by later passes. And finish the "arena"->"allocator" renaming; make renamed allocator pointers that are members of classes const when appropriate (and make a few more members around them const). Test: m test-art-host-gtest Test: testrunner.py --host Bug: 64312607 Change-Id: Ia50aafc80c05941ae5b96984ba4f31ed4c78255e --- compiler/optimizing/optimizing_compiler.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 9bfb7a5c50..42f32b7866 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1146,7 +1146,8 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, if (total_allocated > kArenaAllocatorMemoryReportThreshold) { MemStats mem_stats(allocator.GetMemStats()); MemStats peak_stats(arena_stack.GetPeakStats()); - LOG(INFO) << dex_file.PrettyMethod(method_idx) + LOG(INFO) << "Used " << total_allocated << " bytes of arena memory for compiling " + << dex_file.PrettyMethod(method_idx) << "\n" << Dumpable(mem_stats) << "\n" << Dumpable(peak_stats); } @@ -1256,7 +1257,8 @@ bool OptimizingCompiler::JitCompile(Thread* self, if (total_allocated > kArenaAllocatorMemoryReportThreshold) { MemStats mem_stats(allocator.GetMemStats()); MemStats peak_stats(arena_stack.GetPeakStats()); - LOG(INFO) << dex_file->PrettyMethod(method_idx) + LOG(INFO) << "Used " << total_allocated << " bytes of arena memory for compiling " + << dex_file->PrettyMethod(method_idx) << "\n" << Dumpable(mem_stats) << "\n" << Dumpable(peak_stats); } -- cgit v1.2.3-59-g8ed1b