summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Suren Baghdasaryan <surenb@google.com> 2021-02-26 19:13:56 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-02-26 19:13:56 +0000
commit44c20b347fc4ccba6f0fa7c72e9fa877f65865c2 (patch)
treea7f6bba0e06573d27f1ce09eec6ae851e1a86ada
parent763ecd2ae7cbf673a2a479a992c48af1974d3ceb (diff)
parent355bd7d9b80bf8898f347bb596f13bed232b851d (diff)
Merge "Fix total memtrack Graphics and GL calculations" am: d061730dae am: 355bd7d9b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1604881 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: If10eb20b7dfbe070536afded8ad0e25747a3ed5a
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 88aa46cd7292..8bf2580669b5 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -13384,6 +13384,8 @@ public class ActivityManagerService extends IActivityManager.Stub
}
endTime = SystemClock.currentThreadTimeMillis();
hasSwapPss = mi.hasSwappedOutPss;
+ memtrackGraphics = mi.getOtherPrivate(Debug.MemoryInfo.OTHER_GRAPHICS);
+ memtrackGl = mi.getOtherPrivate(Debug.MemoryInfo.OTHER_GL);
} else {
reportType = ProcessStats.ADD_PSS_EXTERNAL;
startTime = SystemClock.currentThreadTimeMillis();
@@ -13537,6 +13539,8 @@ public class ActivityManagerService extends IActivityManager.Stub
if (!Debug.getMemoryInfo(st.pid, mi)) {
continue;
}
+ memtrackGraphics = mi.getOtherPrivate(Debug.MemoryInfo.OTHER_GRAPHICS);
+ memtrackGl = mi.getOtherPrivate(Debug.MemoryInfo.OTHER_GL);
} else {
long pss = Debug.getPss(st.pid, tmpLong, memtrackTmp);
if (pss == 0) {
@@ -14437,6 +14441,8 @@ public class ActivityManagerService extends IActivityManager.Stub
});
}
final int statsCount = stats.size();
+ long totalMemtrackGraphics = 0;
+ long totalMemtrackGl = 0;
for (int i = 0; i < statsCount; i++) {
ProcessCpuTracker.Stats st = stats.get(i);
long pss = Debug.getPss(st.pid, swaptrackTmp, memtrackTmp);
@@ -14447,6 +14453,8 @@ public class ActivityManagerService extends IActivityManager.Stub
mi.pss = pss;
mi.swapPss = swaptrackTmp[1];
mi.memtrack = memtrackTmp[0];
+ totalMemtrackGraphics += memtrackTmp[1];
+ totalMemtrackGl += memtrackTmp[2];
memInfos.add(mi);
}
}
@@ -14455,20 +14463,18 @@ public class ActivityManagerService extends IActivityManager.Stub
long totalPss = 0;
long totalSwapPss = 0;
long totalMemtrack = 0;
- long totalMemtrackGraphics = 0;
- long totalMemtrackGl = 0;
for (int i=0, N=memInfos.size(); i<N; i++) {
ProcessMemInfo mi = memInfos.get(i);
if (mi.pss == 0) {
mi.pss = Debug.getPss(mi.pid, swaptrackTmp, memtrackTmp);
mi.swapPss = swaptrackTmp[1];
mi.memtrack = memtrackTmp[0];
+ totalMemtrackGraphics += memtrackTmp[1];
+ totalMemtrackGl += memtrackTmp[2];
}
totalPss += mi.pss;
totalSwapPss += mi.swapPss;
totalMemtrack += mi.memtrack;
- totalMemtrackGraphics += memtrackTmp[1];
- totalMemtrackGl += memtrackTmp[2];
}
Collections.sort(memInfos, new Comparator<ProcessMemInfo>() {
@Override public int compare(ProcessMemInfo lhs, ProcessMemInfo rhs) {