Public: anyone can read this; the crew can change it.
Sentinel: memory-growth was degraded 12 minutes today: The forge's own memory is 3928 MiB, over twice its first-hour 1430 MiB and past the 2176 MiB more its database caches m… #17764
Merged 3h 48m ago, live in production
This makes the snapshot stream pass collect its garbage more often. I can't measure whether that is the whole cause, and I never saw the pass's memory on production's data. Why this pass.
-
Reviews
Changes requested — before the latest pushThe direction is sound: it makes the pass collect more often and adds no new cap. The doc paragraph is in the right place, there is no new door and no dependency. One change is needed.
First fix: the 64 MiB pass interval has no test.
SETTLE_BYTESgoes from 256 to 64 MiB and nothing would fail if it went back. The pull says a test needs 64 MiB of real chunks, but it does not.Snapshotteralready has thesettleandsettleBytesseams, and the default is just a constant. ExportSETTLE_BYTES(or the default-resolution helper) and add a test intest/snapshot-stream.test.tsthat asserts it equals 64 MiB. Better, run a pass over a few chunks with a smallsettleBytesand assert how many timessettleran, plus one assertion that the unset default resolves toSETTLE_BYTES. Either would fail on the old 256 MiB value. Every behaviour a change adds needs a test that would fail without it.Second, a lesser point: the new settler test passes its own
read, so it checks the threshold but not that the productionsettler()default uses it. That is fine as the threshold check, but the title says 'default settler'. Reword it or exercisesettler()withheld.readreplaced.The doc is honest that the effect is not measured on production data. Keep that.
ApprovedBoth earlier asks are met. The pass interval is now pinned by a real pass in test/snapshot-stream.test.ts, which asserts 0 < ran < 3 over 80 MiB of random bytes. The 128 MiB full-collection threshold is pinned in test/snapshot-settle.test.ts, quiet at 127 MiB and a full collection at 128 MiB. Both fail on the old constants. The change only lowers two thresholds, adds no cap and no new surface, and the docs paragraph is in docs/features/memory-growth.md, not the README. Two things I would do next, both non-blocking: 1) Non-blocking: after release, read the next finding's
memory outside every heapline at the trip to learn whether this was the whole cause. 2) Non-blocking: watch the loop-stall line while a pass sends changed data, since full collections now run four times as often on a live heap. -
Checks
shipped production is serving it deploy 339cc69
-
History
- Tests pin the pass's 64 MiB default and settler()'s wiring (#17760) 8acb51d
- The snapshot pass collects each 64 MiB it sends and fully each 128 MiB held, a quarter of the pile (#17760) 282a1ab
- A stall's line says whether the thread was computing, queued for a CPU, or blocked (#17752) 411033b
- The watchdog's line says where the silent main thread sits (#17754) 4fe940a
- Merge pull request #17755 from sold/leaf-table-fetch-stub 38eecbb
- Merge pull request #17746 from sold/game-hold e95ca15
- Merge pull request #17750 from sold/leaf-table-2 a4750d3
- infra-page.test.ts puts the real network back when it ends 201dc8b
- Merge pull request #17751 from sold/boot-profile-guard d6c118f
- Merge remote-tracking branch 'origin/main' into sold/games-held 834521e
- Record #17743's squash: its tree is ee1ae6f93 on the same base, both in here 0c9f9a9
- Merge commit '023e432f3a5246bdb0fc87952d183656367a864c^' into sold/games-held e6b9f2b
- Flaky test: no first page's client JavaScript or CSS passes its ceiling, and each page measures the same twice (#17749) cacf546
- The cloud tree's lists sort by any column, from the one line, at every door (#17532) e6cb4d8
- A profile on a live data directory is refused each time 238cd9f
- Merge pull request #17747 from sold/game-putback 74b5cae
- Merge the current base into game-putback 3181d6c
- A plugin's config text with a secret written as an alias is hidden whole (#17745) e2a2838
- A failed up never puts the old AutoStopper back beside ours (#17610) a3038de
- Games, Infrastructure and the other areas are in the navigation, for everyone who may use them (#17633) 3782234
This makes the snapshot stream pass collect its garbage more often. I can't measure whether that is the whole cause, and I never saw the pass's memory on production's data.
Why this pass. snapshot-stream was open across the trip again. The main heap rose 465 → 1393 MiB and fell back to 604 MiB, which is garbage, not a leak. The memory outside every heap rose 845 → 2417 MiB and fell back to 891 MiB, with every held count flat. The main heap is better than the finding after #17558, where it reached 2655 MiB afterwards.
What changed.
- The pass in
src/snapshot/snapshot.tsnow asks for a collection each 64 MiB of plain bytes it sends. It was 256 MiB. settlerinsrc/snapshot/settle.tsnow runs a full collection 128 MiB above the last one. It was 512 MiB.- The pile a pass can leave between collections is about a quarter of what it was.
docs/features/memory-growth.mdhas a new paragraph (#17760).
Test. test/snapshot-settle.test.ts has a new case: the default settler stays quiet at 127 MiB over and runs a full collection at 128 MiB. bun test test/snapshot-settle.test.ts test/snapshot-stream.test.ts passes, tsc --noEmit is clean and gate.ts is clean.
Not done.
- I did not test the 64 MiB pass interval, because that needs 64 MiB of real chunks. Only the 128 MiB full-collection threshold has a test.
- I did not touch
verify-sweep, which was also open at the trip. It runs every 10 minutes and its timing looks coincidental. - The cost is more frequent full collections while a pass sends changed data. Each holds the loop for a short while on a heap of a few hundred MiB.
- The next finding's
memory outside every heapline at the trip will say whether this was enough.
To try it. After a release, read memory-growth on /system for a day. Success is it staying out of the degraded list, or holding under 10 minutes.
🤖 Generated with Claude Code
This pull makes the snapshot stream pass collect its garbage more often, and both thresholds it changes are now pinned by tests. The effect on production memory is still unmeasured.
What changed
- The pass in
src/snapshot/snapshot.tsasks for a collection each 64 MiB of plain bytes sent (was 256 MiB). settlerinsrc/snapshot/settle.tsruns a full collection 128 MiB above the last one (was 512 MiB).docs/features/memory-growth.mdhas a paragraph on it (#17760). It says the effect is not measured on production data.
What the review asked for
- Pass interval test.
test/snapshot-stream.test.tsnow runs a real pass withsettleBytesunset over an 80 MiB random blob in the hosted forge's database. It assertssettleran at least once and fewer than three times. I reverted the constant to 256 MiB and the test failed. Nothing is exported fromsrc/, because tests do not count as callers for the unused-export rule. - Threshold test.
test/snapshot-settle.test.tsnow callssettler()with no seams and drives it throughheld.readandBun.gc. It stays quiet at 127 MiB over and runs a full collection at 128 MiB. The test title says so.
Checks. test/snapshot-settle.test.ts and test/snapshot-stream.test.ts pass (17 tests), tsc --noEmit is clean and gate.ts --fix is clean.
Not done
- I did not touch
verify-sweep, which was also open at the trip. Its timing looks coincidental. - More frequent full collections hold the loop a little longer while a pass sends changed data.
To try it. After a release, watch memory-growth on /system for a day. The goal is that it stays out of the degraded list or holds under 10 minutes. If it still trips, the next finding's memory outside every heap line at the trip will show whether this was enough.
🤖 Generated with Claude Code
This makes the snapshot stream pass collect its garbage more often. I can't measure whether that is the whole cause, and I never saw the pass's memory on production's data.
Why this pass.
snapshot-streamwas open across the trip again. The main heap rose 465 → 1393 MiB and fell back to 604 MiB, which is garbage, not a leak. The memory outside every heap rose 845 → 2417 MiB and fell back to 891 MiB, with every held count flat. The main heap is better than the finding after #17558, where it reached 2655 MiB afterwards.What changed.
src/snapshot/snapshot.tsnow asks for a collection each 64 MiB of plain bytes it sends. It was 256 MiB.settlerinsrc/snapshot/settle.tsnow runs a full collection 128 MiB above the last one. It was 512 MiB.docs/features/memory-growth.mdhas a new paragraph (#17760).Test.
test/snapshot-settle.test.tshas a new case: the default settler stays quiet at 127 MiB over and runs a full collection at 128 MiB.bun test test/snapshot-settle.test.ts test/snapshot-stream.test.tspasses,tsc --noEmitis clean andgate.tsis clean.Not done.
verify-sweep, which was also open at the trip. It runs every 10 minutes and its timing looks coincidental.memory outside every heapline at the trip will say whether this was enough.To try it. After a release, read
memory-growthon/systemfor a day. Success is it staying out of the degraded list, or holding under 10 minutes.🤖 Generated with Claude Code
Closes #17760