diff --git a/docs/BACKLOG.md b/docs/BACKLOG.md index 48da90f7..41cf76c6 100644 --- a/docs/BACKLOG.md +++ b/docs/BACKLOG.md @@ -69,7 +69,7 @@ Han only: each check below needs a real Mac, a second display, a live slideshow run. The multi-display rework is in #468; a real hot-plug and a second monitor are untested. - **24h memory dogfood, #361 / #386.** Instruments stress-cycling found no leak. The Air - now runs the v1.11.2 candidate; read `footprint -p "Hidden Bar"` after a day. #386 (memory grew with every audio or camera change) is closed: the leaked capture listeners were removed in #531, shipped in 1.13.1. #361 is closed as not planned. The hourly soak script is `scripts/memory-soak` (#522, heartbeat #542). The 14-day soak on the Mini ends 2026-11-30; `scripts/memory-soak/summarize` then gives the answer, and no hands are needed for it. + now runs the v1.11.2 candidate; read `footprint -p "Hidden Bar"` after a day. #386 (memory grew with every audio or camera change) is closed: the leaked capture listeners were removed in #531, shipped in 1.13.1. #361 is closed as not planned. The hourly soak script is `scripts/memory-soak` (#522, heartbeat #542). **The 14-day soak on the Mini answered it (2026-11-16 to 2026-11-30, 341 samples): the #386 leak is fixed** (1.13.0 grew about 7 MB a day, 1.13.2 stayed flat for 3.6 days). It also found two things on 1.13.4, cause unknown for both: a slow rise of about 2 MB a day in the two longest clean runs, and one jump from 19 MB to 152 MB inside an hour while the app's windows were in use. No run passed 3.6 days, so weeks of uptime stay untested. Result and the next checks: `docs/verification/memory-soak-result.md`. ## Unverified on hardware for v1.11.2 diff --git a/docs/verification/memory-soak-result.md b/docs/verification/memory-soak-result.md new file mode 100644 index 00000000..271d9643 --- /dev/null +++ b/docs/verification/memory-soak-result.md @@ -0,0 +1,86 @@ +# memory-soak: result of the 14-day run + +| | | +|---|---| +| Question | Does the installed Hidden Bar leak memory over days of uptime? (#386, #361) | +| Run | `scripts/memory-soak`, hourly, on the Mac mini, 2026-11-16 22:19 to 2026-11-30 22:23 (+0700) | +| Samples | 341 with the app running, 0 with it not running, across 14 process ids and four versions | +| Rule | `scripts/memory-soak/README.md`: a leak is footprint and node count both rising across days at the same pid | + +## Verdict + +1. **The #386 leak is fixed.** 1.13.0 grew about 7 MB and 69,000 malloc nodes a day. 1.13.2 ran 3.6 days and stayed flat. +2. **1.13.4 rises slowly in its two longest clean runs.** Footprint grew about 2 MB a day and nodes 8,000 to 12,000 a day, for 2.3 days and 1.25 days. By the rule this is a leak, a small one. Cause unknown. +3. **One 1.13.4 run jumped from 19 MB to 152 MB inside one hour** (peak 303 MB) and held 129 to 168 MB for the 15 hours until the app restarted. Cause unknown. +4. **The soak did not test weeks of uptime.** The app restarted 13 times in 14 days; three of the restarts were version updates. The longest run at one pid was 3.6 days. + +## Command and output + +``` +scripts/memory-soak/summarize +``` + +``` +pid n first sample last up | footprint MB: first last min max | malloc nodes: first last min max +63409 9 2026-11-16T22:19:48+0700 12:03:39 | 18.4 23.2 18.4 23.2 | 63244 93521 63244 93521 +1099 41 2026-11-17T07:02:25+0700 01-14:42:46 | 16.5 28.4 16.5 28.4 | 44675 160396 44675 160396 +84845 1 2026-11-18T22:44:50+0700 14:35 | 16.8 16.8 16.8 16.8 | 43667 43667 43667 43667 +92731 11 2026-11-18T23:44:54+0700 10:31:21 | 16.1 17.6 16.0 17.6 | 43065 43143 43044 43143 +2363 9 2026-11-19T10:33:08+0700 08:00:41 | 17.2 17.7 16.9 17.7 | 44894 46818 43726 46818 +21614 88 2026-11-19T19:33:32+0700 03-15:25:01 | 16.1 18.9 15.8 19.0 | 42439 47289 42439 47438 +99919 32 2026-11-23T11:37:17+0700 01-07:41:53 | 15.5 17.8 15.5 21.6 | 42959 47714 42959 47804 +1235 2 2026-11-24T18:59:54+0700 01:00:30 | 17.1 16.3 16.3 17.1 | 44202 45443 44202 45443 +1040 1 2026-11-24T21:15:51+0700 00:05 | 16.7 16.7 16.7 16.7 | 44938 44938 44938 44938 +1004 18 2026-11-24T21:24:55+0700 17:01:51 | 16.9 18.9 16.7 18.9 | 44638 47645 44393 47670 +1297 40 2026-11-25T15:00:17+0700 01-15:02:38 | 17.5 161.8 16.7 167.8 | 44988 530299 43981 624265 +8538 56 2026-11-27T06:49:02+0700 02-07:02:57 | 17.0 22.0 16.8 26.7 | 45405 64797 45405 65098 +1478 31 2026-11-29T13:59:05+0700 01-06:02:34 | 17.0 19.4 16.3 22.1 | 44760 60356 44760 60356 +1455 2 2026-11-30T20:23:53+0700 01:00:46 | 16.6 16.4 16.4 16.6 | 45310 44479 44479 45310 +``` + +## Growth per run + +Runs of 17 hours or more, from the same log. Rate is last sample minus first sample, over the hours between them. + +| pid | Version | Hours | Footprint MB | MB a day | Nodes | Nodes a day | +|---|---|---|---|---|---|---| +| 1099 | 1.13.0 | 40 | 16.5 to 28.4 | +7.1 | 44,675 to 160,396 | +69,400 | +| 21614 | 1.13.2 | 87 | 16.1 to 18.9 | +0.8 | 42,439 to 47,289 | +1,300 | +| 99919 | 1.13.4 | 31 | 15.5 to 17.8 | +1.8 | 42,959 to 47,714 | +3,700 | +| 1004 | 1.13.4 | 17 | 16.9 to 18.9 | +2.9 | 44,638 to 47,645 | +4,200 | +| 1297 | 1.13.4 | 39 | 17.5 to 161.8 | one jump, see below | 44,988 to 530,299 | one jump | +| 8538 | 1.13.4 | 55 | 17.0 to 22.0 | +2.2 | 45,405 to 64,797 | +8,500 | +| 1478 | 1.13.4 | 30 | 17.0 to 19.4 | +1.9 | 44,760 to 60,356 | +12,500 | + +The 1.13.0 row is the leak #386 reported: #531 removed the leaked capture listeners, and it shipped in 1.13.1. The 1.13.2 row is the control for the fix. + +The node count of pid 8538 rose in every six-hour step. The node count of pid 1478 rose in five of its six five-hour steps. At 2 MB a day, a month of uptime adds about 60 MB. + +## The jump in pid 1297 + +The run was flat for 23 hours (17 MB, 44,000 nodes). Then: + +| Sample (+0700) | Uptime | Footprint MB | Peak MB | Nodes | +|---|---|---|---|---| +| 2026-11-26 13:01 | 22 h | 19.1 | 22.2 | 46,493 | +| 2026-11-26 14:01 | 23 h | 19.1 | 22.2 | 46,504 | +| 2026-11-26 15:01 | 24 h | 152.1 | 303.1 | 623,990 | +| 2026-11-26 17:01 | 26 h | 167.8 | 303.1 | 609,189 | +| 2026-11-26 20:01 | 29 h | 129.4 | 303.1 | 586,310 | +| 2026-11-27 06:02 | 39 h | 161.8 | 303.1 | 530,299 | + +The memory did not come back, and it did not keep growing. + +What the system log shows for the app in that hour (`log show --predicate 'process == "Hidden Bar"'`, 2026-11-26 14:00 to 15:02): two LaunchServices lines at 14:20, then four minutes of activity from 14:52 to 14:56. It holds 17 new window server connections, one `NSInternalInconsistencyException` fault at 14:52:19, and one app launch asked by Hidden Bar at 14:54:28. So someone used the app's own windows in those four minutes. The log does not say which window or which action. + +## What is not known, and the check for each + +- **Cause of the jump.** Check: in the mac-ui VM, read `footprint -p` and `heap` on a fresh 1.13.4, then open each window in turn (Settings and its panes, the Icons list, the type-to-find palette, the arrivals prompt) and read again after each one. +- **Cause of the slow rise on 1.13.4.** Check: two `heap ` class listings a day apart at one pid; the class whose count grows names the owner. +- **Weeks of uptime.** Check: one soak where the app is not updated or restarted for 14 days. + +## Notes on the run + +- Three heartbeat pings failed (curl exit 28 once, exit 7 twice). The samples for those hours are in the log. +- The LaunchAgent booted itself out at the end date. Its vps-mon heartbeat row is already disabled. +- No `heap` call was denied: every sample has a node count.