diff options
| author | 2021-04-28 12:53:00 -0400 | |
|---|---|---|
| committer | 2021-04-28 16:58:21 +0000 | |
| commit | a5df2171fce934a7547c0af425456126ddc0a392 (patch) | |
| tree | 89b9847acc610b1e5401de73e6a2cb91a4e15004 | |
| parent | 1d52698759e00aca1799114bcaf0ec43b1ce6f09 (diff) | |
Fix longstanding 0B in heap tile
Also adds the number of views and ExpandableNotificationRows
to the subtext. The former is likely to be in the 1000s for
a healthy SystemUI process; the latter should be roughly
equivalent to the number of notifications (otherwise there
is a leak).
Fixes: 159917121
Test: make, pull down QS, examine tile
Change-Id: I97b17fb8e991264db612b8a6689051b8d83b4222
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java b/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java index 08cdebd5d80a..d2bbcd50d0e2 100644 --- a/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java +++ b/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java @@ -34,6 +34,7 @@ import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; +import android.os.Debug; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -59,6 +60,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.qs.QSHost; import com.android.systemui.qs.logging.QSLogger; import com.android.systemui.qs.tileimpl.QSTileImpl; +import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -489,12 +491,16 @@ public class GarbageMonitor implements Dumpable { ? "Dumping..." : mContext.getString(R.string.heap_dump_tile_name); if (pmi != null) { + final long views = Debug.countInstancesOfClass(View.class); + final long enrs = Debug.countInstancesOfClass(ExpandableNotificationRow.class); + Log.v(TAG, String.format("updating tile state; rss=%d", pmi.currentRss)); + Log.v(TAG, String.format("views: %d; ExpandableNotificationRows: %d", views, enrs)); icon.setRss(pmi.currentRss); state.secondaryLabel = String.format( - "rss: %s / %s", + "rss=%s views=%d\nenr=%d", formatBytes(pmi.currentRss * 1024), - formatBytes(gm.mHeapLimit * 1024)); + views, enrs); } else { icon.setRss(0); state.secondaryLabel = null; |