Loading services/core/java/com/android/server/am/ActivityManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1841,7 +1841,9 @@ public final class ActivityManagerService extends ActivityManagerNative proc = mPendingPssProcesses.remove(0); procState = proc.pssProcState; lastPssTime = proc.lastPssTime; if (proc.thread != null && procState == proc.setProcState) { if (proc.thread != null && procState == proc.setProcState && (lastPssTime+ProcessList.PSS_SAFE_TIME_FROM_STATE_CHANGE) < SystemClock.uptimeMillis()) { pid = proc.pid; } else { proc = null; Loading Loading @@ -17746,7 +17748,8 @@ public final class ActivityManagerService extends ActivityManagerNative + (app.nextPssTime-now) + ": " + app); } else { if (now > app.nextPssTime || (now > (app.lastPssTime+ProcessList.PSS_MAX_INTERVAL) && now > (app.lastStateTime+ProcessList.PSS_MIN_TIME_FROM_STATE_CHANGE))) { && now > (app.lastStateTime+ProcessList.minTimeFromStateChange( mTestPssMode)))) { requestPssLocked(app, app.setProcState); app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, false, mTestPssMode, isSleeping(), now); services/core/java/com/android/server/am/ProcessList.java +11 −1 Original line number Diff line number Diff line Loading @@ -411,7 +411,10 @@ final class ProcessList { sb.append(ramKb); } // The minimum amount of time after a state change it is safe ro collect PSS. // How long after a state change that it is safe to collect PSS without it being dirty. public static final int PSS_SAFE_TIME_FROM_STATE_CHANGE = 1000; // The minimum time interval after a state change it is safe to collect PSS. public static final int PSS_MIN_TIME_FROM_STATE_CHANGE = 15*1000; // The maximum amount of time we want to go between PSS collections. Loading Loading @@ -441,6 +444,9 @@ final class ProcessList { // The amount of time until PSS when a cached process stays in the same state. private static final int PSS_SAME_CACHED_INTERVAL = 30*60*1000; // The minimum time interval after a state change it is safe to collect PSS. public static final int PSS_TEST_MIN_TIME_FROM_STATE_CHANGE = 10*1000; // The amount of time during testing until PSS when a process first becomes top. private static final int PSS_TEST_FIRST_TOP_INTERVAL = 3*1000; Loading Loading @@ -548,6 +554,10 @@ final class ProcessList { return sProcStateToProcMem[procState1] != sProcStateToProcMem[procState2]; } public static long minTimeFromStateChange(boolean test) { return test ? PSS_TEST_MIN_TIME_FROM_STATE_CHANGE : PSS_MIN_TIME_FROM_STATE_CHANGE; } public static long computeNextPssTime(int procState, boolean first, boolean test, boolean sleeping, long now) { final long[] table = test Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1841,7 +1841,9 @@ public final class ActivityManagerService extends ActivityManagerNative proc = mPendingPssProcesses.remove(0); procState = proc.pssProcState; lastPssTime = proc.lastPssTime; if (proc.thread != null && procState == proc.setProcState) { if (proc.thread != null && procState == proc.setProcState && (lastPssTime+ProcessList.PSS_SAFE_TIME_FROM_STATE_CHANGE) < SystemClock.uptimeMillis()) { pid = proc.pid; } else { proc = null; Loading Loading @@ -17746,7 +17748,8 @@ public final class ActivityManagerService extends ActivityManagerNative + (app.nextPssTime-now) + ": " + app); } else { if (now > app.nextPssTime || (now > (app.lastPssTime+ProcessList.PSS_MAX_INTERVAL) && now > (app.lastStateTime+ProcessList.PSS_MIN_TIME_FROM_STATE_CHANGE))) { && now > (app.lastStateTime+ProcessList.minTimeFromStateChange( mTestPssMode)))) { requestPssLocked(app, app.setProcState); app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, false, mTestPssMode, isSleeping(), now);
services/core/java/com/android/server/am/ProcessList.java +11 −1 Original line number Diff line number Diff line Loading @@ -411,7 +411,10 @@ final class ProcessList { sb.append(ramKb); } // The minimum amount of time after a state change it is safe ro collect PSS. // How long after a state change that it is safe to collect PSS without it being dirty. public static final int PSS_SAFE_TIME_FROM_STATE_CHANGE = 1000; // The minimum time interval after a state change it is safe to collect PSS. public static final int PSS_MIN_TIME_FROM_STATE_CHANGE = 15*1000; // The maximum amount of time we want to go between PSS collections. Loading Loading @@ -441,6 +444,9 @@ final class ProcessList { // The amount of time until PSS when a cached process stays in the same state. private static final int PSS_SAME_CACHED_INTERVAL = 30*60*1000; // The minimum time interval after a state change it is safe to collect PSS. public static final int PSS_TEST_MIN_TIME_FROM_STATE_CHANGE = 10*1000; // The amount of time during testing until PSS when a process first becomes top. private static final int PSS_TEST_FIRST_TOP_INTERVAL = 3*1000; Loading Loading @@ -548,6 +554,10 @@ final class ProcessList { return sProcStateToProcMem[procState1] != sProcStateToProcMem[procState2]; } public static long minTimeFromStateChange(boolean test) { return test ? PSS_TEST_MIN_TIME_FROM_STATE_CHANGE : PSS_MIN_TIME_FROM_STATE_CHANGE; } public static long computeNextPssTime(int procState, boolean first, boolean test, boolean sleeping, long now) { final long[] table = test Loading