Android Memory Diagnose
Explain Android memory behavior without collapsing different ledgers or converting incomplete evidence into certainty.
Workflow
- Start from an
android-memory-ai-contextJSON when available. If it contains multipleevaluated_intents, use the overall support level and inspect everyintent_coverageentry; branch evidence does not prove a simultaneous growth/leak/pressure claim. - If only raw files exist, invoke
$android-memory-evidenceand use its bundledscripts/build_context.pybefore diagnosing. Do not assume the target project containsanalyze.py. - If
evidence.analysis_history.has_prior_analysisis true or the user refers to an earlier conclusion, read references/revision-protocol.md completely. Unless the selected mode is explicitinitial, read the prior conclusion from the current conversation/task and listed report artifacts before writing the follow-up result. If the old conclusion is unavailable, state that blocker rather than inventing a comparison. In explicitinitialmode, do not apply discovered history as a baseline. - Read references/reasoning-protocol.md completely.
- Read references/accounting-domains.md whenever comparing memory values, percentages, or totals.
- When meminfo is available, read references/meminfo-smaps-ledger.md completely. Treat
evidence.accounting_ledgeras the quantitative navigation contract: preserve every meminfo row in source order and attach same-phase smaps evidence per row. Do not replace it with only overview totals or smaps TOP lists. - Read the matching branch in references/intent-routing.md.
- When
qa_observationsor attached QA artifacts exist, read references/qa-signal-interpretation.md completely. Inspect the original authorized log context and each relevant screenshot; do not diagnose from the pattern inventory or image filename alone. - Confirm target package/PID/phase/device/build and resolve reported conflicts. Do not merge values across unresolved identities or clocks.
- Build the current claim ledger independently from the current evidence before comparing it with any old conclusion:
- observed facts tied to artifact IDs;
- derived values with formulas and accounting domains;
- hypotheses with supporting and contradicting evidence;
- missing evidence that would discriminate hypotheses;
- recommendations only after ownership and mechanism are supported.
- For a follow-up, classify every material prior claim as
confirmed,revised,retracted, orunresolved; list genuinely new claims separately. Explain both the evidence delta and the conclusion delta. - Use the selected knowledge records for definitions, proof boundaries, Android-version caveats, and official source URLs.
- Explain current evidence even if coverage is insufficient. Narrow the scope and prioritize collection instead of guessing a root cause.
- Hand a supported owner/mechanism finding to
$android-memory-remediateonly when code changes are requested.
Non-Negotiable Boundaries
- Do not add or subtract values from different accounting domains without a cited formula.
- Do not call high PSS, retained size, object count, Native Heap, Graphics, Unknown, or SwapPss a leak by threshold alone.
- Do not infer a native allocation callsite from a VMA name.
- Do not infer a Java owner from a class histogram without lifecycle expectation and a root/owner path.
- Do not infer LMKD, OOM, memory limiter, freezer, or user kill from process disappearance alone.
- Do not treat an OOM throw site, isolated LeakCanary notification, log keyword, screenshot filename, cropped chart, or single visible value as a proven leak owner or trend.
- Do not present current Android 17 behavior as universal on older devices.
- Do not hide invalid, denied, stale, mixed, or missing artifacts.
Response Shape
Lead with the strongest bounded conclusion. Then provide:
- analysis mode, baseline used, and evidence support level;
- evidence delta: added, changed, missing, and unchanged-by-fingerprint artifacts;
- prior-claim revision table for follow-ups: old claim, status, old binding, current binding, and reason;
- target identity and conflicts;
- the complete meminfo main table in source order when present, with row-level smaps PSS/SwapPss/mapping supplements, comparison status, and explicit non-comparable rows;
- Dalvik Details and the explicit total-reconciliation formula when present;
- observed facts with artifact IDs;
- QA observations with screenshot region or log line/hash binding;
- accounting explanation with knowledge IDs and official sources;
- ranked hypotheses, including evidence for and against each;
- new claims and the conclusion delta;
- what the evidence cannot prove;
- exact next evidence and why it distinguishes the alternatives;
- remediation direction only when owner and mechanism are supported;
- verification conditions.
Use concrete language: “artifact X shows Y in ledger Z” and “this does not prove Q.” Avoid confidence theater and generic optimization lists.