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

Commit 2610b7cb authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #10863270: procstats UI is showing all green

Gah I messed up when refactoring so it would always be told
RAM is low.

Also slightly tune the low memory parameters to go into low
memory states a bit more aggressively.

Change-Id: I5f970349760ad349d515a85c266ab21b387ee353
parent 560d2e46
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -15062,8 +15062,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
        mLastMemoryLevel = memFactor;
        mLastNumProcesses = mLruProcesses.size();
        boolean allChanged = mProcessStats.setMemFactorLocked(
                ProcessStats.ADJ_MEM_FACTOR_NORMAL, !mSleeping, now);
        boolean allChanged = mProcessStats.setMemFactorLocked(memFactor, !mSleeping, now);
        final int trackerMemFactor = mProcessStats.getMemFactorLocked();
        if (memFactor != ProcessStats.ADJ_MEM_FACTOR_NORMAL) {
            if (mLowRamStartTime == 0) {
+1 −9
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ final class ProcessList {

    // The number of cached at which we don't consider it necessary to do
    // memory trimming.
    static final int TRIM_CACHED_APPS = (MAX_CACHED_APPS-MAX_EMPTY_APPS)/2;
    static final int TRIM_CACHED_APPS = ((MAX_CACHED_APPS-MAX_EMPTY_APPS)*2)/3;

    // Threshold of number of cached+empty where we consider memory critical.
    static final int TRIM_CRITICAL_THRESHOLD = 3;
@@ -141,14 +141,6 @@ final class ProcessList {
    // Threshold of number of cached+empty where we consider memory critical.
    static final int TRIM_LOW_THRESHOLD = 5;

    // We put empty content processes after any cached processes that have
    // been idle for less than 15 seconds.
    static final long CONTENT_APP_IDLE_OFFSET = 15*1000;

    // We put empty content processes after any cached processes that have
    // been idle for less than 120 seconds.
    static final long EMPTY_APP_IDLE_OFFSET = 120*1000;

    // These are the various interesting memory levels that we will give to
    // the OOM killer.  Note that the OOM killer only supports 6 slots, so we
    // can't give it a different value for every possible kind of process.