summaryrefslogtreecommitdiffstats
path: root/dex2oat/dex2oat.cc
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2015-03-06 08:44:45 -0800
committerBrian Carlstrom <bdc@google.com>2015-03-06 08:44:45 -0800
commita11a34c908e847711e6ccf221d61b45d0c4c963d (patch)
treeeeb7d47eec30c3850b450f77c21a34a66cd80e9c /dex2oat/dex2oat.cc
parentb341b70b2418922d9b792cdba96d22bece87c55a (diff)
downloadart-a11a34c908e847711e6ccf221d61b45d0c4c963d.zip
art-a11a34c908e847711e6ccf221d61b45d0c4c963d.tar.gz
art-a11a34c908e847711e6ccf221d61b45d0c4c963d.tar.bz2
Do not dump memory usage if driver was never created
Bug: https://code.google.com/p/android/issues/detail?id=158593 Change-Id: I8084f9ac823910aa11f854f3e764240741fbf0d5
Diffstat (limited to 'dex2oat/dex2oat.cc')
-rw-r--r--dex2oat/dex2oat.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 8572f4d..128f623 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1647,9 +1647,10 @@ class Dex2Oat FINAL {
void LogCompletionTime() {
// Note: when creation of a runtime fails, e.g., when trying to compile an app but when there
// is no image, there won't be a Runtime::Current().
+ // Note: driver creation can fail when loading an invalid dex file.
LOG(INFO) << "dex2oat took " << PrettyDuration(NanoTime() - start_ns_)
<< " (threads: " << thread_count_ << ") "
- << ((Runtime::Current() != nullptr) ?
+ << ((Runtime::Current() != nullptr && driver_.get() != nullptr) ?
driver_->GetMemoryUsageString(kIsDebugBuild || VLOG_IS_ON(compiler)) :
"");
}