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

Commit e00bb2a3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Check if RssAnon and swap were read" into rvc-dev am: b0a6429f am: 806f779c

Change-Id: I9ee106a00ac274a6d6ae76026a336e89db94a7e8
parents 9ec5c28f 806f779c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -41,10 +41,11 @@ public final class ProcfsMemoryUtil {
    public static MemorySnapshot readMemorySnapshotFromProcfs(int pid) {
        long[] output = new long[STATUS_KEYS.length];
        output[0] = -1;
        output[3] = -1;
        output[4] = -1;
        Process.readProcLines("/proc/" + pid + "/status", STATUS_KEYS, output);
        if (output[0] == -1 || (output[3] == 0 && output[4] == 0)) {
            // Could not open file or anon rss / swap are 0 indicating the process is in a zombie
            // state.
        if (output[0] == -1 || output[3] == -1 || output[4] == -1) {
            // Could not open or parse file.
            return null;
        }
        final MemorySnapshot snapshot = new MemorySnapshot();