diff options
author | 2016-02-17 10:09:00 +0000 | |
---|---|---|
committer | 2016-02-17 10:09:00 +0000 | |
commit | 908cb978e81cdde9c0c02d131acbb3ff35aaf3db (patch) | |
tree | 59efb73abe56b22e10d7fe95eadf4571ebb06200 /compiler/driver/compiler_driver.cc | |
parent | b93c21e83c8fbf0191093c01a8951adb5be9010b (diff) | |
parent | dd9473b94c15c8cbdfcce702fdc7a50acdfbfd8b (diff) |
Merge "dex2oat: Show memory usage values in bytes"
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index f078bf6507..670fe94988 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -2732,16 +2732,18 @@ bool CompilerDriver::RequiresConstructorBarrier(Thread* self, const DexFile* dex std::string CompilerDriver::GetMemoryUsageString(bool extended) const { std::ostringstream oss; 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()); + const ArenaPool* const arena_pool = runtime->GetArenaPool(); + const gc::Heap* const heap = runtime->GetHeap(); + const size_t arena_alloc = arena_pool->GetBytesAllocated(); + const size_t java_alloc = heap->GetBytesAllocated(); + oss << "arena alloc=" << PrettySize(arena_alloc) << " (" << arena_alloc << "B)"; + oss << " java alloc=" << PrettySize(java_alloc) << " (" << java_alloc << "B)"; #if defined(__BIONIC__) || defined(__GLIBC__) - struct mallinfo info = mallinfo(); + const struct mallinfo info = mallinfo(); const size_t allocated_space = static_cast<size_t>(info.uordblks); const size_t free_space = static_cast<size_t>(info.fordblks); - oss << " native alloc=" << PrettySize(allocated_space) << " free=" - << PrettySize(free_space); + oss << " native alloc=" << PrettySize(allocated_space) << " (" << allocated_space << "B)" + << " free=" << PrettySize(free_space) << " (" << free_space << "B)"; #endif compiled_method_storage_.DumpMemoryUsage(oss, extended); return oss.str(); |