Loading services/core/java/com/android/server/am/ActivityManagerService.java +13 −6 Original line number Diff line number Diff line Loading @@ -1308,7 +1308,7 @@ public final class ActivityManagerService extends ActivityManagerNative int mMemWatchDumpUid; String mTrackAllocationApp = null; final long[] mTmpLong = new long[1]; final long[] mTmpLong = new long[2]; static final class ProcessChangeItem { static final int CHANGE_ACTIVITIES = 1<<0; Loading Loading @@ -2241,7 +2241,7 @@ public final class ActivityManagerService extends ActivityManagerNative } int num = 0; long[] tmp = new long[1]; long[] tmp = new long[2]; do { ProcessRecord proc; int procState; Loading Loading @@ -2273,7 +2273,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (pss != 0 && proc.thread != null && proc.setProcState == procState && proc.pid == pid && proc.lastPssTime == lastPssTime) { num++; recordPssSampleLocked(proc, procState, pss, tmp[0], recordPssSampleLocked(proc, procState, pss, tmp[0], tmp[1], SystemClock.uptimeMillis()); } } Loading Loading @@ -12259,6 +12259,8 @@ public final class ActivityManagerService extends ActivityManagerNative sb.append(proc.processName); sb.append(" in idle maint: pss="); sb.append(proc.lastPss); sb.append(", swapPss="); sb.append(proc.lastSwapPss); sb.append(", initialPss="); sb.append(proc.initialIdlePss); sb.append(", period="); Loading Loading @@ -15166,6 +15168,7 @@ public final class ActivityManagerService extends ActivityManagerNative pw.print("state: cur="); pw.print(ProcessList.makeProcStateString(r.curProcState)); pw.print(" set="); pw.print(ProcessList.makeProcStateString(r.setProcState)); pw.print(" lastPss="); DebugUtils.printSizeValue(pw, r.lastPss*1024); pw.print(" lastSwapPss="); DebugUtils.printSizeValue(pw, r.lastSwapPss*1024); pw.print(" lastCachedPss="); DebugUtils.printSizeValue(pw, r.lastCachedPss*1024); pw.println(); pw.print(prefix); Loading Loading @@ -19148,8 +19151,10 @@ public final class ActivityManagerService extends ActivityManagerNative /** * Record new PSS sample for a process. */ void recordPssSampleLocked(ProcessRecord proc, int procState, long pss, long uss, long now) { EventLogTags.writeAmPss(proc.pid, proc.uid, proc.processName, pss * 1024, uss * 1024); void recordPssSampleLocked(ProcessRecord proc, int procState, long pss, long uss, long swapPss, long now) { EventLogTags.writeAmPss(proc.pid, proc.uid, proc.processName, pss * 1024, uss * 1024, swapPss * 1024); proc.lastPssTime = now; proc.baseProcessTracker.addPss(pss, uss, true, proc.pkgList); if (DEBUG_PSS) Slog.d(TAG_PSS, Loading @@ -19159,8 +19164,10 @@ public final class ActivityManagerService extends ActivityManagerNative proc.initialIdlePss = pss; } proc.lastPss = pss; proc.lastSwapPss = swapPss; if (procState >= ActivityManager.PROCESS_STATE_HOME) { proc.lastCachedPss = pss; proc.lastCachedSwapPss = swapPss; } final SparseArray<Pair<Long, String>> watchUids Loading Loading @@ -19596,7 +19603,7 @@ public final class ActivityManagerService extends ActivityManagerNative // states, which well tend to give noisy data. long start = SystemClock.uptimeMillis(); long pss = Debug.getPss(app.pid, mTmpLong, null); recordPssSampleLocked(app, app.curProcState, pss, mTmpLong[0], now); recordPssSampleLocked(app, app.curProcState, pss, mTmpLong[0], mTmpLong[1], now); mPendingPssProcesses.remove(app); Slog.i(TAG, "Recorded pss for " + app + " state " + app.setProcState + " to " + app.curProcState + ": " services/core/java/com/android/server/am/EventLogTags.logtags +2 −2 Original line number Diff line number Diff line Loading @@ -100,6 +100,6 @@ option java_package com.android.server.am 30045 am_pre_boot (User|1|5),(Package|3) # Report collection of global memory state 30046 am_meminfo (CachedKb|2|2),(FreeKb|2|2),(ZramKb|2|2),(KernelKb|2|2),(NativeKb|2|2) 30046 am_meminfo (Cached|2|2),(Free|2|2),(Zram|2|2),(Kernel|2|2),(Native|2|2) # Report collection of memory used by a process 30047 am_pss (Pid|1|5),(UID|1|5),(Process Name|3),(PssKb|2|2),(UssKb|2|2) 30047 am_pss (Pid|1|5),(UID|1|5),(Process Name|3),(Pss|2|2),(Uss|2|2),(SwapPss|2|2) services/core/java/com/android/server/am/ProcessRecord.java +4 −0 Original line number Diff line number Diff line Loading @@ -82,7 +82,9 @@ final class ProcessRecord { long lastStateTime; // Last time setProcState changed long initialIdlePss; // Initial memory pss of process for idle maintenance. long lastPss; // Last computed memory pss. long lastSwapPss; // Last computed SwapPss. long lastCachedPss; // Last computed pss when in cached state. long lastCachedSwapPss; // Last computed SwapPss when in cached state. int maxAdj; // Maximum OOM adjustment for this process int curRawAdj; // Current OOM unlimited adjustment for this process int setRawAdj; // Last set OOM unlimited adjustment for this process Loading Loading @@ -257,7 +259,9 @@ final class ProcessRecord { pw.print(prefix); pw.print("adjSeq="); pw.print(adjSeq); pw.print(" lruSeq="); pw.print(lruSeq); pw.print(" lastPss="); DebugUtils.printSizeValue(pw, lastPss*1024); pw.print(" lastSwapPss="); DebugUtils.printSizeValue(pw, lastSwapPss*1024); pw.print(" lastCachedPss="); DebugUtils.printSizeValue(pw, lastCachedPss*1024); pw.print(" lastCachedSwapPss="); DebugUtils.printSizeValue(pw, lastCachedSwapPss*1024); pw.println(); pw.print(prefix); pw.print("cached="); pw.print(cached); pw.print(" empty="); pw.println(empty); Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +13 −6 Original line number Diff line number Diff line Loading @@ -1308,7 +1308,7 @@ public final class ActivityManagerService extends ActivityManagerNative int mMemWatchDumpUid; String mTrackAllocationApp = null; final long[] mTmpLong = new long[1]; final long[] mTmpLong = new long[2]; static final class ProcessChangeItem { static final int CHANGE_ACTIVITIES = 1<<0; Loading Loading @@ -2241,7 +2241,7 @@ public final class ActivityManagerService extends ActivityManagerNative } int num = 0; long[] tmp = new long[1]; long[] tmp = new long[2]; do { ProcessRecord proc; int procState; Loading Loading @@ -2273,7 +2273,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (pss != 0 && proc.thread != null && proc.setProcState == procState && proc.pid == pid && proc.lastPssTime == lastPssTime) { num++; recordPssSampleLocked(proc, procState, pss, tmp[0], recordPssSampleLocked(proc, procState, pss, tmp[0], tmp[1], SystemClock.uptimeMillis()); } } Loading Loading @@ -12259,6 +12259,8 @@ public final class ActivityManagerService extends ActivityManagerNative sb.append(proc.processName); sb.append(" in idle maint: pss="); sb.append(proc.lastPss); sb.append(", swapPss="); sb.append(proc.lastSwapPss); sb.append(", initialPss="); sb.append(proc.initialIdlePss); sb.append(", period="); Loading Loading @@ -15166,6 +15168,7 @@ public final class ActivityManagerService extends ActivityManagerNative pw.print("state: cur="); pw.print(ProcessList.makeProcStateString(r.curProcState)); pw.print(" set="); pw.print(ProcessList.makeProcStateString(r.setProcState)); pw.print(" lastPss="); DebugUtils.printSizeValue(pw, r.lastPss*1024); pw.print(" lastSwapPss="); DebugUtils.printSizeValue(pw, r.lastSwapPss*1024); pw.print(" lastCachedPss="); DebugUtils.printSizeValue(pw, r.lastCachedPss*1024); pw.println(); pw.print(prefix); Loading Loading @@ -19148,8 +19151,10 @@ public final class ActivityManagerService extends ActivityManagerNative /** * Record new PSS sample for a process. */ void recordPssSampleLocked(ProcessRecord proc, int procState, long pss, long uss, long now) { EventLogTags.writeAmPss(proc.pid, proc.uid, proc.processName, pss * 1024, uss * 1024); void recordPssSampleLocked(ProcessRecord proc, int procState, long pss, long uss, long swapPss, long now) { EventLogTags.writeAmPss(proc.pid, proc.uid, proc.processName, pss * 1024, uss * 1024, swapPss * 1024); proc.lastPssTime = now; proc.baseProcessTracker.addPss(pss, uss, true, proc.pkgList); if (DEBUG_PSS) Slog.d(TAG_PSS, Loading @@ -19159,8 +19164,10 @@ public final class ActivityManagerService extends ActivityManagerNative proc.initialIdlePss = pss; } proc.lastPss = pss; proc.lastSwapPss = swapPss; if (procState >= ActivityManager.PROCESS_STATE_HOME) { proc.lastCachedPss = pss; proc.lastCachedSwapPss = swapPss; } final SparseArray<Pair<Long, String>> watchUids Loading Loading @@ -19596,7 +19603,7 @@ public final class ActivityManagerService extends ActivityManagerNative // states, which well tend to give noisy data. long start = SystemClock.uptimeMillis(); long pss = Debug.getPss(app.pid, mTmpLong, null); recordPssSampleLocked(app, app.curProcState, pss, mTmpLong[0], now); recordPssSampleLocked(app, app.curProcState, pss, mTmpLong[0], mTmpLong[1], now); mPendingPssProcesses.remove(app); Slog.i(TAG, "Recorded pss for " + app + " state " + app.setProcState + " to " + app.curProcState + ": "
services/core/java/com/android/server/am/EventLogTags.logtags +2 −2 Original line number Diff line number Diff line Loading @@ -100,6 +100,6 @@ option java_package com.android.server.am 30045 am_pre_boot (User|1|5),(Package|3) # Report collection of global memory state 30046 am_meminfo (CachedKb|2|2),(FreeKb|2|2),(ZramKb|2|2),(KernelKb|2|2),(NativeKb|2|2) 30046 am_meminfo (Cached|2|2),(Free|2|2),(Zram|2|2),(Kernel|2|2),(Native|2|2) # Report collection of memory used by a process 30047 am_pss (Pid|1|5),(UID|1|5),(Process Name|3),(PssKb|2|2),(UssKb|2|2) 30047 am_pss (Pid|1|5),(UID|1|5),(Process Name|3),(Pss|2|2),(Uss|2|2),(SwapPss|2|2)
services/core/java/com/android/server/am/ProcessRecord.java +4 −0 Original line number Diff line number Diff line Loading @@ -82,7 +82,9 @@ final class ProcessRecord { long lastStateTime; // Last time setProcState changed long initialIdlePss; // Initial memory pss of process for idle maintenance. long lastPss; // Last computed memory pss. long lastSwapPss; // Last computed SwapPss. long lastCachedPss; // Last computed pss when in cached state. long lastCachedSwapPss; // Last computed SwapPss when in cached state. int maxAdj; // Maximum OOM adjustment for this process int curRawAdj; // Current OOM unlimited adjustment for this process int setRawAdj; // Last set OOM unlimited adjustment for this process Loading Loading @@ -257,7 +259,9 @@ final class ProcessRecord { pw.print(prefix); pw.print("adjSeq="); pw.print(adjSeq); pw.print(" lruSeq="); pw.print(lruSeq); pw.print(" lastPss="); DebugUtils.printSizeValue(pw, lastPss*1024); pw.print(" lastSwapPss="); DebugUtils.printSizeValue(pw, lastSwapPss*1024); pw.print(" lastCachedPss="); DebugUtils.printSizeValue(pw, lastCachedPss*1024); pw.print(" lastCachedSwapPss="); DebugUtils.printSizeValue(pw, lastCachedSwapPss*1024); pw.println(); pw.print(prefix); pw.print("cached="); pw.print(cached); pw.print(" empty="); pw.println(empty); Loading