Loading core/java/android/os/Debug.java +12 −8 Original line number Diff line number Diff line Loading @@ -1749,21 +1749,25 @@ public final class Debug /** @hide */ public static final int MEMINFO_SLAB = 5; /** @hide */ public static final int MEMINFO_SWAP_TOTAL = 6; public static final int MEMINFO_SLAB_RECLAIMABLE = 6; /** @hide */ public static final int MEMINFO_SWAP_FREE = 7; public static final int MEMINFO_SLAB_UNRECLAIMABLE = 7; /** @hide */ public static final int MEMINFO_ZRAM_TOTAL = 8; public static final int MEMINFO_SWAP_TOTAL = 8; /** @hide */ public static final int MEMINFO_MAPPED = 9; public static final int MEMINFO_SWAP_FREE = 9; /** @hide */ public static final int MEMINFO_VM_ALLOC_USED = 10; public static final int MEMINFO_ZRAM_TOTAL = 10; /** @hide */ public static final int MEMINFO_PAGE_TABLES = 11; public static final int MEMINFO_MAPPED = 11; /** @hide */ public static final int MEMINFO_KERNEL_STACK = 12; public static final int MEMINFO_VM_ALLOC_USED = 12; /** @hide */ public static final int MEMINFO_COUNT = 13; public static final int MEMINFO_PAGE_TABLES = 13; /** @hide */ public static final int MEMINFO_KERNEL_STACK = 14; /** @hide */ public static final int MEMINFO_COUNT = 15; /** * Retrieves /proc/meminfo. outSizes is filled with fields Loading core/java/com/android/internal/util/MemInfoReader.java +2 −2 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public final class MemInfoReader { * that are mapped in to processes. */ public long getCachedSizeKb() { return mInfos[Debug.MEMINFO_BUFFERS] return mInfos[Debug.MEMINFO_BUFFERS] + mInfos[Debug.MEMINFO_SLAB_RECLAIMABLE] + mInfos[Debug.MEMINFO_CACHED] - mInfos[Debug.MEMINFO_MAPPED]; } Loading @@ -90,7 +90,7 @@ public final class MemInfoReader { * Amount of RAM that is in use by the kernel for actual allocations. */ public long getKernelUsedSizeKb() { return mInfos[Debug.MEMINFO_SHMEM] + mInfos[Debug.MEMINFO_SLAB] return mInfos[Debug.MEMINFO_SHMEM] + mInfos[Debug.MEMINFO_SLAB_UNRECLAIMABLE] + mInfos[Debug.MEMINFO_VM_ALLOC_USED] + mInfos[Debug.MEMINFO_PAGE_TABLES] + mInfos[Debug.MEMINFO_KERNEL_STACK]; } Loading core/jni/android_os_Debug.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -705,6 +705,8 @@ enum { MEMINFO_CACHED, MEMINFO_SHMEM, MEMINFO_SLAB, MEMINFO_SLAB_RECLAIMABLE, MEMINFO_SLAB_UNRECLAIMABLE, MEMINFO_SWAP_TOTAL, MEMINFO_SWAP_FREE, MEMINFO_ZRAM_TOTAL, Loading Loading @@ -776,6 +778,8 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o "Cached:", "Shmem:", "Slab:", "SReclaimable:", "SUnreclaim:", "SwapTotal:", "SwapFree:", "ZRam:", Loading @@ -792,6 +796,8 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o 7, 6, 5, 13, 11, 10, 9, 5, Loading @@ -801,7 +807,7 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o 12, 0 }; long mem[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long mem[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; char* p = buffer; while (*p && numFound < (sizeof(tagsLen) / sizeof(tagsLen[0]))) { Loading Loading
core/java/android/os/Debug.java +12 −8 Original line number Diff line number Diff line Loading @@ -1749,21 +1749,25 @@ public final class Debug /** @hide */ public static final int MEMINFO_SLAB = 5; /** @hide */ public static final int MEMINFO_SWAP_TOTAL = 6; public static final int MEMINFO_SLAB_RECLAIMABLE = 6; /** @hide */ public static final int MEMINFO_SWAP_FREE = 7; public static final int MEMINFO_SLAB_UNRECLAIMABLE = 7; /** @hide */ public static final int MEMINFO_ZRAM_TOTAL = 8; public static final int MEMINFO_SWAP_TOTAL = 8; /** @hide */ public static final int MEMINFO_MAPPED = 9; public static final int MEMINFO_SWAP_FREE = 9; /** @hide */ public static final int MEMINFO_VM_ALLOC_USED = 10; public static final int MEMINFO_ZRAM_TOTAL = 10; /** @hide */ public static final int MEMINFO_PAGE_TABLES = 11; public static final int MEMINFO_MAPPED = 11; /** @hide */ public static final int MEMINFO_KERNEL_STACK = 12; public static final int MEMINFO_VM_ALLOC_USED = 12; /** @hide */ public static final int MEMINFO_COUNT = 13; public static final int MEMINFO_PAGE_TABLES = 13; /** @hide */ public static final int MEMINFO_KERNEL_STACK = 14; /** @hide */ public static final int MEMINFO_COUNT = 15; /** * Retrieves /proc/meminfo. outSizes is filled with fields Loading
core/java/com/android/internal/util/MemInfoReader.java +2 −2 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public final class MemInfoReader { * that are mapped in to processes. */ public long getCachedSizeKb() { return mInfos[Debug.MEMINFO_BUFFERS] return mInfos[Debug.MEMINFO_BUFFERS] + mInfos[Debug.MEMINFO_SLAB_RECLAIMABLE] + mInfos[Debug.MEMINFO_CACHED] - mInfos[Debug.MEMINFO_MAPPED]; } Loading @@ -90,7 +90,7 @@ public final class MemInfoReader { * Amount of RAM that is in use by the kernel for actual allocations. */ public long getKernelUsedSizeKb() { return mInfos[Debug.MEMINFO_SHMEM] + mInfos[Debug.MEMINFO_SLAB] return mInfos[Debug.MEMINFO_SHMEM] + mInfos[Debug.MEMINFO_SLAB_UNRECLAIMABLE] + mInfos[Debug.MEMINFO_VM_ALLOC_USED] + mInfos[Debug.MEMINFO_PAGE_TABLES] + mInfos[Debug.MEMINFO_KERNEL_STACK]; } Loading
core/jni/android_os_Debug.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -705,6 +705,8 @@ enum { MEMINFO_CACHED, MEMINFO_SHMEM, MEMINFO_SLAB, MEMINFO_SLAB_RECLAIMABLE, MEMINFO_SLAB_UNRECLAIMABLE, MEMINFO_SWAP_TOTAL, MEMINFO_SWAP_FREE, MEMINFO_ZRAM_TOTAL, Loading Loading @@ -776,6 +778,8 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o "Cached:", "Shmem:", "Slab:", "SReclaimable:", "SUnreclaim:", "SwapTotal:", "SwapFree:", "ZRam:", Loading @@ -792,6 +796,8 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o 7, 6, 5, 13, 11, 10, 9, 5, Loading @@ -801,7 +807,7 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o 12, 0 }; long mem[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; long mem[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; char* p = buffer; while (*p && numFound < (sizeof(tagsLen) / sizeof(tagsLen[0]))) { Loading