summaryrefslogtreecommitdiffstats
path: root/compiler/dex/frontend.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/dex/frontend.cc')
-rw-r--r--compiler/dex/frontend.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index b55b4715eb..1c2d16f6ca 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -98,6 +98,7 @@ CompilationUnit::CompilationUnit(ArenaPool* pool)
num_regs(0),
compiler_flip_match(false),
arena(pool),
+ arena_stack(pool),
mir_graph(NULL),
cg(NULL),
timings("QuickCompiler", true, false) {
@@ -247,9 +248,12 @@ static CompiledMethod* CompileMethod(CompilerDriver& driver,
}
if (cu.enable_debug & (1 << kDebugShowMemoryUsage)) {
- if (cu.arena.BytesAllocated() > (5 * 1024 *1024)) {
- MemStats mem_stats(cu.arena);
- LOG(INFO) << PrettyMethod(method_idx, dex_file) << " " << Dumpable<MemStats>(mem_stats);
+ if (cu.arena.BytesAllocated() > (1 * 1024 *1024) ||
+ cu.arena_stack.PeakBytesAllocated() > 256 * 1024) {
+ MemStats mem_stats(cu.arena.GetMemStats());
+ MemStats peak_stats(cu.arena_stack.GetPeakStats());
+ LOG(INFO) << PrettyMethod(method_idx, dex_file) << " " << Dumpable<MemStats>(mem_stats)
+ << Dumpable<MemStats>(peak_stats);
}
}