Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8dcf59d6 authored by Thierry Strudel's avatar Thierry Strudel
Browse files

Do not account ZRAM physical memory as Lost RAM

Bug: 26039328
Change-Id: I0f28ed777e10a90186700b4879c69f827a3c0495
parent b4f4dc4e
Loading
Loading
Loading
Loading
+6 −7
Original line number Original line Diff line number Diff line
@@ -15797,18 +15797,17 @@ public final class ActivityManagerService extends ActivityManagerNative
                    pw.println(totalPss - cachedPss);
                    pw.println(totalPss - cachedPss);
                }
                }
            }
            }
            long lostRAM = memInfo.getTotalSizeKb()
                    - totalPss - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
                    - memInfo.getKernelUsedSizeKb() - memInfo.getZramTotalSizeKb();
            if (!isCompact) {
            if (!isCompact) {
                pw.print(" Used RAM: "); pw.print(stringifyKBSize(totalPss - cachedPss
                pw.print(" Used RAM: "); pw.print(stringifyKBSize(totalPss - cachedPss
                        + memInfo.getKernelUsedSizeKb())); pw.print(" (");
                        + memInfo.getKernelUsedSizeKb())); pw.print(" (");
                pw.print(stringifyKBSize(totalPss - cachedPss)); pw.print(" used pss + ");
                pw.print(stringifyKBSize(totalPss - cachedPss)); pw.print(" used pss + ");
                pw.print(stringifyKBSize(memInfo.getKernelUsedSizeKb())); pw.print(" kernel)\n");
                pw.print(stringifyKBSize(memInfo.getKernelUsedSizeKb())); pw.print(" kernel)\n");
                pw.print(" Lost RAM: "); pw.println(stringifyKBSize(memInfo.getTotalSizeKb()
                pw.print(" Lost RAM: "); pw.println(stringifyKBSize(lostRAM));
                        - totalPss - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
                        - memInfo.getKernelUsedSizeKb()));
            } else {
            } else {
                pw.print("lostram,"); pw.println(memInfo.getTotalSizeKb()
                pw.print("lostram,"); pw.println(lostRAM);
                        - totalPss - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
                        - memInfo.getKernelUsedSizeKb());
            }
            }
            if (!brief) {
            if (!brief) {
                if (memInfo.getZramTotalSizeKb() != 0) {
                if (memInfo.getZramTotalSizeKb() != 0) {
@@ -16106,7 +16105,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        memInfoBuilder.append("  Lost RAM: ");
        memInfoBuilder.append("  Lost RAM: ");
        memInfoBuilder.append(stringifyKBSize(memInfo.getTotalSizeKb()
        memInfoBuilder.append(stringifyKBSize(memInfo.getTotalSizeKb()
                - totalPss - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
                - totalPss - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
                - memInfo.getKernelUsedSizeKb()));
                - memInfo.getKernelUsedSizeKb() - memInfo.getZramTotalSizeKb()));
        memInfoBuilder.append("\n");
        memInfoBuilder.append("\n");
        Slog.i(TAG, "Low on memory:");
        Slog.i(TAG, "Low on memory:");
        Slog.i(TAG, shortNativeBuilder.toString());
        Slog.i(TAG, shortNativeBuilder.toString());