Loading core/java/com/android/internal/util/MemInfoReader.java +7 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,13 @@ public final class MemInfoReader { return mInfos[Debug.MEMINFO_FREE]; } /** * Amount of RAM that used by shared memory (shmem) and tmpfs */ public long getShmemSizeKb() { return mInfos[Debug.MEMINFO_SHMEM]; } /** * Amount of RAM that the kernel is being used for caches, not counting caches * that are mapped in to processes. Loading services/core/java/com/android/server/am/ActivityManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -13143,6 +13143,8 @@ public class ActivityManagerService extends IActivityManager.Stub final long lostRAM = memInfo.getTotalSizeKb() - (ss[INDEX_TOTAL_PSS] - ss[INDEX_TOTAL_SWAP_PSS]) - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb() // NR_SHMEM is subtracted twice (getCachedSizeKb() and getKernelUsedSizeKb()) + memInfo.getShmemSizeKb() - kernelUsed - memInfo.getZramTotalSizeKb(); if (!opts.isCompact) { pw.print(" Used RAM: "); pw.print(stringifyKBSize(ss[INDEX_TOTAL_PSS] - cachedPss Loading Loading @@ -13656,6 +13658,8 @@ public class ActivityManagerService extends IActivityManager.Stub long lostRAM = memInfo.getTotalSizeKb() - (ss[INDEX_TOTAL_PSS] - ss[INDEX_TOTAL_SWAP_PSS]) - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb() // NR_SHMEM is subtracted twice (getCachedSizeKb() and getKernelUsedSizeKb()) + memInfo.getShmemSizeKb() - memInfo.getKernelUsedSizeKb() - memInfo.getZramTotalSizeKb(); proto.write(MemInfoDumpProto.USED_PSS_KB, ss[INDEX_TOTAL_PSS] - cachedPss); proto.write(MemInfoDumpProto.USED_KERNEL_KB, memInfo.getKernelUsedSizeKb()); Loading
core/java/com/android/internal/util/MemInfoReader.java +7 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,13 @@ public final class MemInfoReader { return mInfos[Debug.MEMINFO_FREE]; } /** * Amount of RAM that used by shared memory (shmem) and tmpfs */ public long getShmemSizeKb() { return mInfos[Debug.MEMINFO_SHMEM]; } /** * Amount of RAM that the kernel is being used for caches, not counting caches * that are mapped in to processes. Loading
services/core/java/com/android/server/am/ActivityManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -13143,6 +13143,8 @@ public class ActivityManagerService extends IActivityManager.Stub final long lostRAM = memInfo.getTotalSizeKb() - (ss[INDEX_TOTAL_PSS] - ss[INDEX_TOTAL_SWAP_PSS]) - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb() // NR_SHMEM is subtracted twice (getCachedSizeKb() and getKernelUsedSizeKb()) + memInfo.getShmemSizeKb() - kernelUsed - memInfo.getZramTotalSizeKb(); if (!opts.isCompact) { pw.print(" Used RAM: "); pw.print(stringifyKBSize(ss[INDEX_TOTAL_PSS] - cachedPss Loading Loading @@ -13656,6 +13658,8 @@ public class ActivityManagerService extends IActivityManager.Stub long lostRAM = memInfo.getTotalSizeKb() - (ss[INDEX_TOTAL_PSS] - ss[INDEX_TOTAL_SWAP_PSS]) - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb() // NR_SHMEM is subtracted twice (getCachedSizeKb() and getKernelUsedSizeKb()) + memInfo.getShmemSizeKb() - memInfo.getKernelUsedSizeKb() - memInfo.getZramTotalSizeKb(); proto.write(MemInfoDumpProto.USED_PSS_KB, ss[INDEX_TOTAL_PSS] - cachedPss); proto.write(MemInfoDumpProto.USED_KERNEL_KB, memInfo.getKernelUsedSizeKb());