Skip to content

Commit 90f9e31

Browse files
Björn Davidssonjredestig
authored andcommitted
Performance: Activity manager perf unnecessary recalc of oom_adj
If an activity has bound servicesor content providers, updateLruProcessInternalLocked will be called recursively with the oomAdj flag set, resulting in several recalculations of oomAdj with unchanged data. Doing it at the end of the top level call to updateLruProcessInternalLocked should be sufficient. Change-Id: I95e27011e1d3519f256a9bd756cbb18d43e8db29
1 parent 0748a56 commit 90f9e31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/java/com/android/server/am/ActivityManagerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,15 +1757,15 @@ private final void updateLruProcessInternalLocked(ProcessRecord app,
17571757
if (cr.binding != null && cr.binding.service != null
17581758
&& cr.binding.service.app != null
17591759
&& cr.binding.service.app.lruSeq != mLruSeq) {
1760-
updateLruProcessInternalLocked(cr.binding.service.app, oomAdj,
1760+
updateLruProcessInternalLocked(cr.binding.service.app, false,
17611761
updateActivityTime, i+1);
17621762
}
17631763
}
17641764
}
17651765
if (app.conProviders.size() > 0) {
17661766
for (ContentProviderRecord cpr : app.conProviders.keySet()) {
17671767
if (cpr.proc != null && cpr.proc.lruSeq != mLruSeq) {
1768-
updateLruProcessInternalLocked(cpr.proc, oomAdj,
1768+
updateLruProcessInternalLocked(cpr.proc, false,
17691769
updateActivityTime, i+1);
17701770
}
17711771
}

0 commit comments

Comments
 (0)