MemoryTracker/WeightWatcher improvements.

- remove dead pids
  - compact display

Change-Id: I23f0de31f6ac6e9a556ac3c78b81eed94f59ca93
This commit is contained in:
Daniel Sandler
2013-06-27 22:39:26 -04:00
parent e060b0b3c7
commit 0becf1fa0c
2 changed files with 13 additions and 3 deletions
+11 -1
View File
@@ -127,7 +127,17 @@ public class MemoryTracker extends Service {
info.uss[info.head] = info.currentUss = dinfo.getTotalPrivateDirty();
if (info.currentPss > info.max) info.max = info.currentPss;
if (info.currentUss > info.max) info.max = info.currentUss;
Log.v(TAG, "update: pid " + pid + " pss=" + info.currentPss + " uss=" + info.currentUss);
// Log.v(TAG, "update: pid " + pid + " pss=" + info.currentPss + " uss=" + info.currentUss);
if (info.currentPss == 0) {
Log.v(TAG, "update: pid " + pid + " has pss=0, it probably died");
mData.remove(pid);
}
}
for (int i=mPids.size()-1; i>=0; i--) {
final long pid = mPids.get(i).intValue();
if (mData.get(pid) == null) {
mPids.remove(i);
}
}
// XXX: notify listeners