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

Commit 423c44dc authored by Andres Morales's avatar Andres Morales
Browse files

[DO NOT MERGE] Increase min free levels for cached processes on 64bit

Requires less memory pressure to start killing cached
processes.

Change-Id: Ia02f5aee115535badc900330b9361f0099203e4f
parent 4cc7ae80
Loading
Loading
Loading
Loading
+6 −12
Original line number Original line Diff line number Diff line
@@ -177,7 +177,7 @@ final class ProcessList {
    // 1280x800 or larger screen with around 1GB RAM.  Values are in KB.
    // 1280x800 or larger screen with around 1GB RAM.  Values are in KB.
    private final int[] mOomMinFreeHigh = new int[] {
    private final int[] mOomMinFreeHigh = new int[] {
            73728, 92160, 110592,
            73728, 92160, 110592,
            129024, 147456, 184320
            129024, 225000, 325000
    };
    };
    // The actual OOM killer memory levels we are using.
    // The actual OOM killer memory levels we are using.
    private final int[] mOomMinFree = new int[mOomAdj.length];
    private final int[] mOomMinFree = new int[mOomAdj.length];
@@ -235,22 +235,16 @@ final class ProcessList {
            Slog.i("XXXXXX", "minfree_adj=" + minfree_adj + " minfree_abs=" + minfree_abs);
            Slog.i("XXXXXX", "minfree_adj=" + minfree_adj + " minfree_abs=" + minfree_abs);
        }
        }


        // We've now baked in the increase to the basic oom values above, since
        if (Build.SUPPORTED_64_BIT_ABIS.length > 0) {
        // they seem to be useful more generally for devices that are tight on
            // Increase the high min-free levels for cached processes for 64-bit
        // memory than just for 64 bit.  This should probably have some more
            mOomMinFreeHigh[4] = 225000;
        // tuning done, so not deleting it quite yet...
            mOomMinFreeHigh[5] = 325000;
        final boolean is64bit = false; //Build.SUPPORTED_64_BIT_ABIS.length > 0;
        }


        for (int i=0; i<mOomAdj.length; i++) {
        for (int i=0; i<mOomAdj.length; i++) {
            int low = mOomMinFreeLow[i];
            int low = mOomMinFreeLow[i];
            int high = mOomMinFreeHigh[i];
            int high = mOomMinFreeHigh[i];
            mOomMinFree[i] = (int)(low + ((high-low)*scale));
            mOomMinFree[i] = (int)(low + ((high-low)*scale));
            if (is64bit) {
                // On 64 bit devices, we consume more baseline RAM, because 64 bit is cool!
                // To avoid being all pagey and stuff, scale up the memory levels to
                // give us some breathing room.
                mOomMinFree[i] = (3*mOomMinFree[i])/2;
            }
        }
        }


        if (minfree_abs >= 0) {
        if (minfree_abs >= 0) {