Finding and fixing Android memory leaks with Perfetto, SQL, and AI agents · @shaibarack, Android platform system health, Google · Perfetto blog, November 27, 2026
Perfetto ships a memory-leak skill for coding agents, built around a reproduce-first test loop
Most of the post is a guide to Perfetto's heap profiling, its Heap Dump Explorer and PerfettoSQL queries over heap graphs. The last part introduces an open-source skill for coding agents. The post lists support for Claude Code, Codex, OpenCode, Cursor, Antigravity and any agent that reads SKILL.md workflows, and the Claude Code install is one line: /plugin marketplace add google/perfetto@ai-agents. The skill bundles a trace_processor wrapper and three workflows: dominator triage on a single heap dump, duplicate-object and caching analysis, and clustering of retention paths across many traces. The agent queries the trace, reads the source, edits the class and runs the unit tests itself.
The post describes how Google uses it: "At Google, we use this workflow as a grounding approach." The agent finds a leak in a heap profile, writes a test that should reproduce it, runs the test and checks the resulting heap profile to confirm the leak actually appeared, then reuses that test as the regression test for its fix. Only after those steps does it notify a human reviewer with "a high-confidence analysis and a patch with test coverage." The leak patterns in the post are described as based on real bugs in Google Messages, YouTube, Google Camera and other Google apps. The three agent sessions it shows use example package names, so they illustrate the workflow rather than report results. The post gives no figures for how often the loop succeeds.
Why it matters: This is a tool vendor shipping its query language and its debugging procedure as something an agent can load, with an oracle that sits outside the agent. The heap profile, not the agent's own claim, decides whether the test reproduced the bug, and that check is the part worth copying into other verification loops. Whether it holds up on your app is untested here.