summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amith Yamasani <yamasani@google.com> 2019-06-24 16:47:44 -0700
committer Amith Yamasani <yamasani@google.com> 2019-06-24 16:47:44 -0700
commit853d509c53445ce6c76635bf7b4c2745e2c1b11c (patch)
tree9b183a61269dc2afcd6f7affe8e307dcf1336531
parent956197e8e03706cda1c1d4885f33862029dd5ff4 (diff)
Fix a regression in setting oom_adj for cached processes
If a cached process happens to be part of a cycle, it might end up at a score of 1001, which is never reported to lmkd and hence not killed when under memory pressure. Fix: When recomputing oom adjust scores for apps in cycles, use the last computed raw adj value instead of UNKNOWN_ADJ. Fixes: 135948152 Test: atest CtsAppTestCases:ActivityManagerProcessStateTests Launch specific known apps that have internal cycles and ensure they end up with an oom_adj in the 900s. Change-Id: I000e6a06cd23873d09b9df3e9ddd280232757d3a
-rw-r--r--services/core/java/com/android/server/am/OomAdjuster.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 5ade50a5f248..bcfe71b82a6a 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -431,7 +431,7 @@ public final class OomAdjuster {
for (int i = 0; i < N; i++) {
ProcessRecord app = mProcessList.mLruProcesses.get(i);
if (!app.killedByAm && app.thread != null && app.containsCycle == true) {
- if (computeOomAdjLocked(app, ProcessList.UNKNOWN_ADJ, TOP_APP, true, now,
+ if (computeOomAdjLocked(app, app.getCurRawAdj(), TOP_APP, true, now,
true)) {
retryCycles = true;
}