From 8da8cbfefc365068e17340c28c8acecef2d15e11 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 4 Jun 2019 13:11:16 -0700 Subject: [PATCH] Fix some bugs in dumpsys meminfo attribution ART image files can end with either .art or .art] depending on where they are loaded from, add handling for this. Also fix subheap attribution to HEAP_ART_BOOT and HEAP_ART_APP for the app image case. Test: adb shell dumpsys meminfo `pid system_server` Bug: 134509632 Change-Id: I98882466d7c2f31179b095b803af67d21c17306c --- core/jni/android_os_Debug.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index a67cb34e19dd7..842679ec7d223 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -289,14 +289,14 @@ static void load_maps(int pid, stats_t* stats, bool* foundSwapPss) } else if (base::EndsWith(name, ".oat")) { which_heap = HEAP_OAT; is_swappable = true; - } else if (base::EndsWith(name, ".art")) { + } else if (base::EndsWith(name, ".art") || base::EndsWith(name, ".art]")) { which_heap = HEAP_ART; // Handle system@framework@boot* and system/framework/boot* if ((strstr(name.c_str(), "@boot") != nullptr) || (strstr(name.c_str(), "/boot"))) { - sub_heap = HEAP_DEX_BOOT_VDEX; + sub_heap = HEAP_ART_BOOT; } else { - sub_heap = HEAP_DEX_APP_VDEX; + sub_heap = HEAP_ART_APP; } is_swappable = true; } else if (base::StartsWith(name, "/dev/")) {