)]}'
{
  "commit": "3793d8516ea6b87ff2c69ce0083cd4041786c7ea",
  "tree": "03e3089a05c4bb58fd66c33a0b9706fb5a49de99",
  "parents": [
    "48d4c0b3690a724e9e267ca4bb6af5b02824992f"
  ],
  "author": {
    "name": "Pierre-Yves Ricau",
    "email": "py@squareup.com",
    "time": "Wed Aug 05 08:49:48 2026"
  },
  "committer": {
    "name": "Pierre-Yves Ricau",
    "email": "py@squareup.com",
    "time": "Fri Aug 21 14:54:07 2026"
  },
  "message": "Hold a decor view through its window, and the window through its screen\n\nThe decor view rule was `Activity.mDecor` / `Dialog.mDecor`, and that field\nis null on a live activity more often than not. `handleResumeActivity` is\nthe only place that writes it, under `r.window \u003d\u003d null`, so it is set once\nper `ActivityClientRecord` rather than once per `Activity` — a screen\nrecreated on a configuration change is resumed, visible, and has a null\n`mDecor` for the rest of its life. `PhoneWindow.mDecor` has no such gap:\nevery decor view in the seven real dumps here is pointed at by exactly one.\n\nMoving the decor view under its window puts a window\u0027s 3 MB where the\nwindow lands, so the window needs a rule too — 6 of the 16 windows in\nthose dumps were drawn at the top of the tree, held by a `ViewRootImpl`\nor a `WindowManagerImpl` as well as by their activity. With the second\nrule every decor view is under its window and every window of a screen\nthat is up is under that screen.\n\nThat second rule is the one whose owning reference outlives the construct\nit is about: `Activity.mWindow` is set in `attach` and never cleared and\n`Dialog.mWindow` is final, so a destroyed activity and a dismissed dialog\ngo on pointing at a window they have nothing left to do with. Owning it\nanyway took the window of a leaked screen away from whatever else held it,\nand turned two leaks into one on the list.\n\nSo it owns through `mWindow` and asks whether the screen is up of another\nreference, one the framework does drop — the self-clearing kind every other\nrule owns by, borrowed from beside the one this rule owns through. A dialog\nis dropped from its own `mDecor`, which `show` sets and `dismiss` nulls; an\nactivity is dropped from `ActivityThread.mActivities`, which\n`handleDestroyActivity` removes the record from and which the activity rule\nalready owns activities by. No rule reads the state of an object.\n\nBytes are conserved on all eight dumps in the repo, no object joins or\nleaves the tree, and 0 to 16 objects of 34 K to 340 K move.\n\nCo-Authored-By: Claude Opus 5 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8dafe9aa7705c40ade03ac14f4e205b62018fe40",
      "old_mode": 33188,
      "old_path": "shark/shark-explorer/notes/dominator-tree.md",
      "new_id": "7f4c0d0f5c415686168e42f2f861c4ab5419e6ca",
      "new_mode": 33188,
      "new_path": "shark/shark-explorer/notes/dominator-tree.md"
    },
    {
      "type": "modify",
      "old_id": "7985b5b795634bb190943b22934b59a8b3f23bfb",
      "old_mode": 33188,
      "old_path": "shark/shark-explorer/shark-explorer-core/src/main/java/shark/explorer/OwnerRules.kt",
      "new_id": "534266960685ab8dd79090f6fa1a65f1c4bb2a61",
      "new_mode": 33188,
      "new_path": "shark/shark-explorer/shark-explorer-core/src/main/java/shark/explorer/OwnerRules.kt"
    },
    {
      "type": "modify",
      "old_id": "fdc4b9dedbbacd802ef09b03020fe6a1ddc9dbcc",
      "old_mode": 33188,
      "old_path": "shark/shark-explorer/shark-explorer-core/src/main/java/shark/explorer/RunningActivityReferenceReader.kt",
      "new_id": "fd2bf75d81153cce870957ac7a66476a856a80c1",
      "new_mode": 33188,
      "new_path": "shark/shark-explorer/shark-explorer-core/src/main/java/shark/explorer/RunningActivityReferenceReader.kt"
    },
    {
      "type": "modify",
      "old_id": "e7cbfd044eaa46f28bc7d5712eee0c6f24882c06",
      "old_mode": 33188,
      "old_path": "shark/shark-explorer/shark-explorer-core/src/test/java/shark/explorer/OwnerReferencesTest.kt",
      "new_id": "684a164095c0a65ccef4e07aed4d42f6de9de968",
      "new_mode": 33188,
      "new_path": "shark/shark-explorer/shark-explorer-core/src/test/java/shark/explorer/OwnerReferencesTest.kt"
    }
  ]
}
