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

Commit 7f4d9034 authored by Edgar Arriaga's avatar Edgar Arriaga Committed by Edgar Arriaga García
Browse files

Avoid full compaction when apps move within Cached bucket

This patch reduces the amount of times we trigger full compactions
that currently happen at any OOM adjust change when the app is
within the Cached state bucket as it was identified that there
were many instances of this situation.

Bug: 232311101
Test: Checked that the number of full compactions went down in
dumpsys activity

Change-Id: If4995432cbf770227ebd60dad2889522d98b103d
parent 414923e8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1235,7 +1235,8 @@ public final class CachedAppOptimizer {
                && (newAdj == ProcessList.PREVIOUS_APP_ADJ || newAdj == ProcessList.HOME_APP_ADJ)) {
            // Perform a minor compaction when a perceptible app becomes the prev/home app
            compactAppSome(app, false);
        } else if (newAdj >= ProcessList.CACHED_APP_MIN_ADJ
        } else if (oldAdj < ProcessList.CACHED_APP_MIN_ADJ
                && newAdj >= ProcessList.CACHED_APP_MIN_ADJ
                && newAdj <= ProcessList.CACHED_APP_MAX_ADJ) {
            // Perform a major compaction when any app enters cached
            compactAppFull(app, false);