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

Commit 0d42abec authored by Tim Murray's avatar Tim Murray
Browse files

ProcessList: fix lmkd minfree rules

Moving CACHED_APP_MAX_ADJ to 999 without actually setting processes
to 999 results in the first LMK rule failing to kill anything ever.
Add a new constant for the oom_adj score used by the first LMK rule.

Test: lmkd no longer fails to kill adj 999 constantly
bug 123024834

Change-Id: Iaee5e7395faa897ee46eb13354f9e15a6363de9f
parent 31a11dcd
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -145,6 +145,11 @@ public final class ProcessList {
    static final int CACHED_APP_MAX_ADJ = 999;
    static final int CACHED_APP_MIN_ADJ = 900;

    // This is the oom_adj level that we allow to die first. This cannot be equal to
    // CACHED_APP_MAX_ADJ unless processes are actively being assigned an oom_score_adj of
    // CACHED_APP_MAX_ADJ.
    static final int CACHED_APP_LMK_FIRST_ADJ = 950;

    // Number of levels we have available for different service connection group importance
    // levels.
    static final int CACHED_APP_IMPORTANCE_LEVELS = 5;
@@ -266,7 +271,7 @@ public final class ProcessList {
    // can't give it a different value for every possible kind of process.
    private final int[] mOomAdj = new int[] {
            FOREGROUND_APP_ADJ, VISIBLE_APP_ADJ, PERCEPTIBLE_APP_ADJ,
            BACKUP_APP_ADJ, CACHED_APP_MIN_ADJ, CACHED_APP_MAX_ADJ
            BACKUP_APP_ADJ, CACHED_APP_MIN_ADJ, CACHED_APP_LMK_FIRST_ADJ
    };
    // These are the low-end OOM level limits.  This is appropriate for an
    // HVGA or smaller phone with less than 512MB.  Values are in KB.