Loading services/core/java/com/android/server/am/ActivityManagerService.java +13 −4 Original line number Diff line number Diff line Loading @@ -1532,6 +1532,11 @@ public class ActivityManagerService extends IActivityManager.Stub */ int mBootPhase; /** * The time stamp that all apps have received BOOT_COMPLETED. */ volatile long mBootCompletedTimestamp; @GuardedBy("this") boolean mDeterministicUidIdle = false; Loading Loading @@ -5164,10 +5169,14 @@ public class ActivityManagerService extends IActivityManager.Stub public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered, boolean sticky, int sendingUser) { mBootCompletedTimestamp = SystemClock.uptimeMillis(); // Defer the full Pss collection as the system is really busy now. mHandler.postDelayed(() -> { synchronized (mProcLock) { mAppProfiler.requestPssAllProcsLPr( SystemClock.uptimeMillis(), true, false); } }, mConstants.FULL_PSS_MIN_INTERVAL); } }); maybeLogUserspaceRebootEvent(); Loading services/core/java/com/android/server/am/ProcessList.java +2 −2 Original line number Diff line number Diff line Loading @@ -1439,7 +1439,7 @@ public final class ProcessList { } public static long computeNextPssTime(int procState, ProcStateMemTracker tracker, boolean test, boolean sleeping, long now) { boolean sleeping, long now, long earliest) { boolean first; float scalingFactor; final int memState = sProcStateToProcMem[procState]; Loading Loading @@ -1470,7 +1470,7 @@ public final class ProcessList { if (delay > PSS_MAX_INTERVAL) { delay = PSS_MAX_INTERVAL; } return now + delay; return Math.max(now + delay, earliest); } long getMemLevel(int adjustment) { Loading services/core/java/com/android/server/am/ProcessProfileRecord.java +5 −1 Original line number Diff line number Diff line Loading @@ -575,7 +575,11 @@ final class ProcessProfileRecord { @GuardedBy("mProfilerLock") long computeNextPssTime(int procState, boolean test, boolean sleeping, long now) { return ProcessList.computeNextPssTime(procState, mProcStateMemTracker, test, sleeping, now); return ProcessList.computeNextPssTime(procState, mProcStateMemTracker, test, sleeping, now, // Cap the Pss time to make sure no Pss is collected during the very few // minutes after the system is boot, given the system is already busy. Math.max(mService.mBootCompletedTimestamp, mService.mLastIdleTime) + mService.mConstants.FULL_PSS_MIN_INTERVAL); } private static void commitNextPssTime(ProcStateMemTracker tracker) { Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +13 −4 Original line number Diff line number Diff line Loading @@ -1532,6 +1532,11 @@ public class ActivityManagerService extends IActivityManager.Stub */ int mBootPhase; /** * The time stamp that all apps have received BOOT_COMPLETED. */ volatile long mBootCompletedTimestamp; @GuardedBy("this") boolean mDeterministicUidIdle = false; Loading Loading @@ -5164,10 +5169,14 @@ public class ActivityManagerService extends IActivityManager.Stub public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered, boolean sticky, int sendingUser) { mBootCompletedTimestamp = SystemClock.uptimeMillis(); // Defer the full Pss collection as the system is really busy now. mHandler.postDelayed(() -> { synchronized (mProcLock) { mAppProfiler.requestPssAllProcsLPr( SystemClock.uptimeMillis(), true, false); } }, mConstants.FULL_PSS_MIN_INTERVAL); } }); maybeLogUserspaceRebootEvent(); Loading
services/core/java/com/android/server/am/ProcessList.java +2 −2 Original line number Diff line number Diff line Loading @@ -1439,7 +1439,7 @@ public final class ProcessList { } public static long computeNextPssTime(int procState, ProcStateMemTracker tracker, boolean test, boolean sleeping, long now) { boolean sleeping, long now, long earliest) { boolean first; float scalingFactor; final int memState = sProcStateToProcMem[procState]; Loading Loading @@ -1470,7 +1470,7 @@ public final class ProcessList { if (delay > PSS_MAX_INTERVAL) { delay = PSS_MAX_INTERVAL; } return now + delay; return Math.max(now + delay, earliest); } long getMemLevel(int adjustment) { Loading
services/core/java/com/android/server/am/ProcessProfileRecord.java +5 −1 Original line number Diff line number Diff line Loading @@ -575,7 +575,11 @@ final class ProcessProfileRecord { @GuardedBy("mProfilerLock") long computeNextPssTime(int procState, boolean test, boolean sleeping, long now) { return ProcessList.computeNextPssTime(procState, mProcStateMemTracker, test, sleeping, now); return ProcessList.computeNextPssTime(procState, mProcStateMemTracker, test, sleeping, now, // Cap the Pss time to make sure no Pss is collected during the very few // minutes after the system is boot, given the system is already busy. Math.max(mService.mBootCompletedTimestamp, mService.mLastIdleTime) + mService.mConstants.FULL_PSS_MIN_INTERVAL); } private static void commitNextPssTime(ProcStateMemTracker tracker) { Loading