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