From 95550dd39440196d364767fc18d441ed5a0e36d6 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 13 Jul 2017 15:01:34 -0700 Subject: Add more details to dumpsys meminfo -d Added new subitems for .dex: boot vdex app vdex app odex .art app art boot art Fixed accounting for dalvik other to be subitems of other subsection instead of dalvik. Sample output: 261,892K: Native 213,196K: .dex mmap 111,620K: .App vdex 65,070K: .App dex 36,506K: .Boot vdex 192,320K: EGL mtrack 161,835K: .so mmap 134,922K: .apk mmap 85,612K: Dalvik 74,656K: .Heap 4,526K: .Zygote 4,218K: .LOS 2,212K: .NonMoving 64,906K: Unknown 52,119K: .oat mmap 42,828K: Dalvik Other 32,704K: .LinearAlloc 3,672K: .JITCache 3,248K: .IndirectRef 3,204K: .GC 40,754K: .art mmap 31,133K: .Boot art 9,621K: .App art 21,976K: Other mmap 20,704K: Stack 16,270K: Gfx dev 9,200K: GL mtrack 3,428K: Other dev 2,744K: .ttf mmap 1,116K: Ashmem 1,052K: .jar mmap 0K: Cursor 0K: Other mtrack Test: dumpsys meminfo -d Test: dumpsys meminfo -s Test: dumpsys meminfo Test: dumpsys meminfo Test: dumpsys memifno -d Bug: 32331673 Change-Id: Ib46aac6c6cd23f8594d4d06d8651d83f04c0b4d7 --- core/java/android/os/Debug.java | 71 ++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 12 deletions(-) (limited to 'core/java/android/os/Debug.java') diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index f243f377cb56..75fea5253674 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -223,28 +223,69 @@ public final class Debug /** @hide */ public static final int OTHER_OTHER_MEMTRACK = 16; + // Needs to be declared here for the DVK_STAT ranges below. + /** @hide */ + public static final int NUM_OTHER_STATS = 17; + + // Dalvik subsections. /** @hide */ public static final int OTHER_DALVIK_NORMAL = 17; /** @hide */ public static final int OTHER_DALVIK_LARGE = 18; /** @hide */ - public static final int OTHER_DALVIK_LINEARALLOC = 19; + public static final int OTHER_DALVIK_ZYGOTE = 19; + /** @hide */ + public static final int OTHER_DALVIK_NON_MOVING = 20; + // Section begins and ends for dumpsys, relative to the DALVIK categories. + /** @hide */ + public static final int OTHER_DVK_STAT_DALVIK_START = + OTHER_DALVIK_NORMAL - NUM_OTHER_STATS; /** @hide */ - public static final int OTHER_DALVIK_ACCOUNTING = 20; + public static final int OTHER_DVK_STAT_DALVIK_END = + OTHER_DALVIK_NON_MOVING - NUM_OTHER_STATS; + + // Dalvik Other subsections. + /** @hide */ + public static final int OTHER_DALVIK_OTHER_LINEARALLOC = 21; + /** @hide */ + public static final int OTHER_DALVIK_OTHER_ACCOUNTING = 22; /** @hide */ - public static final int OTHER_DALVIK_CODE_CACHE = 21; + public static final int OTHER_DALVIK_OTHER_CODE_CACHE = 23; /** @hide */ - public static final int OTHER_DALVIK_ZYGOTE = 22; + public static final int OTHER_DALVIK_OTHER_COMPILER_METADATA = 24; /** @hide */ - public static final int OTHER_DALVIK_NON_MOVING = 23; + public static final int OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE = 25; /** @hide */ - public static final int OTHER_DALVIK_INDIRECT_REFERENCE_TABLE = 24; + public static final int OTHER_DVK_STAT_DALVIK_OTHER_START = + OTHER_DALVIK_OTHER_LINEARALLOC - NUM_OTHER_STATS; + /** @hide */ + public static final int OTHER_DVK_STAT_DALVIK_OTHER_END = + OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE - NUM_OTHER_STATS; + // Dex subsections (Boot vdex, App dex, and App vdex). /** @hide */ - public static final int NUM_OTHER_STATS = 17; + public static final int OTHER_DEX_BOOT_VDEX = 26; + /** @hide */ + public static final int OTHER_DEX_APP_DEX = 27; + /** @hide */ + public static final int OTHER_DEX_APP_VDEX = 28; + /** @hide */ + public static final int OTHER_DVK_STAT_DEX_START = OTHER_DEX_BOOT_VDEX - NUM_OTHER_STATS; + /** @hide */ + public static final int OTHER_DVK_STAT_DEX_END = OTHER_DEX_APP_VDEX - NUM_OTHER_STATS; + + // Art subsections (App image, boot image). + /** @hide */ + public static final int OTHER_ART_APP = 29; + /** @hide */ + public static final int OTHER_ART_BOOT = 30; + /** @hide */ + public static final int OTHER_DVK_STAT_ART_START = OTHER_ART_APP - NUM_OTHER_STATS; + /** @hide */ + public static final int OTHER_DVK_STAT_ART_END = OTHER_ART_BOOT - NUM_OTHER_STATS; /** @hide */ - public static final int NUM_DVK_STATS = 8; + public static final int NUM_DVK_STATS = 14; /** @hide */ public static final int NUM_CATEGORIES = 8; @@ -408,12 +449,18 @@ public final class Debug case OTHER_OTHER_MEMTRACK: return "Other mtrack"; case OTHER_DALVIK_NORMAL: return ".Heap"; case OTHER_DALVIK_LARGE: return ".LOS"; - case OTHER_DALVIK_LINEARALLOC: return ".LinearAlloc"; - case OTHER_DALVIK_ACCOUNTING: return ".GC"; - case OTHER_DALVIK_CODE_CACHE: return ".JITCache"; case OTHER_DALVIK_ZYGOTE: return ".Zygote"; case OTHER_DALVIK_NON_MOVING: return ".NonMoving"; - case OTHER_DALVIK_INDIRECT_REFERENCE_TABLE: return ".IndirectRef"; + case OTHER_DALVIK_OTHER_LINEARALLOC: return ".LinearAlloc"; + case OTHER_DALVIK_OTHER_ACCOUNTING: return ".GC"; + case OTHER_DALVIK_OTHER_CODE_CACHE: return ".JITCache"; + case OTHER_DALVIK_OTHER_COMPILER_METADATA: return ".CompilerMetadata"; + case OTHER_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE: return ".IndirectRef"; + case OTHER_DEX_BOOT_VDEX: return ".Boot vdex"; + case OTHER_DEX_APP_DEX: return ".App dex"; + case OTHER_DEX_APP_VDEX: return ".App vdex"; + case OTHER_ART_APP: return ".App art"; + case OTHER_ART_BOOT: return ".Boot art"; default: return "????"; } } -- cgit v1.2.3