Public: anyone can read this; the crew can change it.
Sentinel: memory-growth was degraded 18 minutes today: The forge's own memory is 5017 MiB, over twice its first-hour 1654 MiB and past the 2176 MiB more its database caches m… #17436
Merged 36h 1m ago, live in production
The stream pass now collects garbage after each forge (Bun.gc(false) in streamPass, src/snapshot/stream.ts). This is a best guess at the cause, and I could not measure it against production's data. What the evidence says.
-
Reviews
ApprovedApproved. The change is small and does what the issue asked:
streamPassruns a collection after each forge, whether it succeeded or failed, through an injectablesettlehook. The test pins the order (take, settle, take, settle) for both outcomes. It adds no rule, cap or hold, there is no web or terminal surface, and the how-to is in docs/features/memory-growth.md, not the README. It is honest that it is unmeasured.Two things I would do next:
- Fix the number in the source comment. It says the heap went 595 to 3700 MiB inside one pass, but the docs paragraph and the issue say 2587 MiB at the trip. Use one figure.
- Measure it.
Bun.gc(false)only requests a collection, and much of Bun's buffer memory is external to the JS heap. If the next finding still shows RSS growth withsnapshot-streamopen, capture a heap on a copy of production's data, as the pull suggests. Also addmemory heap mainat the end of each forge in a pass to the evidence, so the finding can tell whether the collection did anything.
-
Checks
shipped production is serving it deploy f8f8b8f
-
History
- Direction: the stream pass collects garbage after each forge so the main heap does not pile up across a pass (#17434) bb6b1d5
- A tab forge's service worker answers home and the issue list from the tab's store (#17363) 517654c
- See and manage everything on any cloud: provider ▸ account ▸ project ▸ resources, the cloud's own view, a console that always works (#17253) 3ceb22f
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1qrob4aq1a is past its budget: trevato/forge: "migrate from the terminal > repositories are listed newest push first, and two ticked start two migrati… (#17413) b7cd143
- Sentinel re-files a closed budget breach every 2 minutes: breach findings car… (#17409) ecacbd4
- Sentinel: budget:check:time is past its budget: runs of this kind were stopped by it (#17401) 047cce7
- A "Red after landing" issue for a pinned landing waits for a second red, and closes on green even after the crew parked it (#17399) 47c4893
- Full suite red: test/deadends.test.ts (#17396) bbce193
- The terminal's migrate sorts each account's repositories by last push, previews a pasted URL, and migrates several at once, like /migrate (#17393) 60c9fe8
- The browser forge's own button: checkpoint, upload to /forges/move-in, start the shared forge (#17397) 5ec7388
- Cloud says: every machine shows what its provider reports, even when its agent is silent (#17156) 5f8c9dc
- Mail key doors: which scope is in effect, set and remove an override, redaction across surfaces (#17385) 8efca4b
- scripts/reach.ts: one line of how far tests reach into the tree, printed by main's verification (#17392) 45bf539
- The forge image runs Bun 1.4.5, its security release (SQLite 3.54.1); the pin follows once it is live (#17390) 24cd3eb
- Tick up to 20 of an account's repositories on /migrate and start them all with one "Migrate selected" (#17381) 8cfc9b1
- Game servers sleep while empty and wake when someone joins (AutoStopper on Velocity) (#17290) cdf0f4f
- The asks ledger takes the write lock first, so a commit beside it is a wait, not "database is locked" (#17389) f77bccd
- Full suite red: 6 files in check run 01m8tdk9wtkadjy8jpcssa7smg (#17387) f386d9b
- Merge pull request #17227 from sold/workspace-dev-cell 3690d74
- Dev server reads the working tree: every sync puts the saved files back; no directory made through a link 93adc62
The stream pass now collects garbage after each forge (Bun.gc(false) in streamPass, src/snapshot/stream.ts). This is a best guess at the cause, and I could not measure it against production's data.
What the evidence says. The main heap went from 595 MiB to 2587 MiB at the trip, then fell back to 513 MiB. No held count rose, so this looks like garbage piling up, not a leak. snapshot-stream was the job open across the trip, as on #17205.
The suspected cause. A pass over N hosted forges lists the bucket N + 1 times, each listing a Set of every chunk key. It also cuts every chunk through fresh buffers. The collector let a whole pass's worth build up before it ran. Collecting between forges keeps the peak at one forge's garbage instead of the whole pass's.
What changed.
streamPasstakes an optionalsettlehook, defaulting toBun.gc(false), and runs it after each forge whether that forge succeeded or failed.test/snapshot-stream.test.tshas a new test checking thatsettleruns after every forge. That file passes (10 tests) andtscis clean. I did not run the rest of the suite orscripts/fast.ts; the forge's check runs the full suite.docs/features/memory-growth.mdhas a new paragraph on this change, including that it is unmeasured.
What I chose not to do. I did not skip the fresh bucket listing before each manifest. It guards against a sweep deleting chunks mid-pass, so removing it is a safety decision for a person.
How to tell if it worked. The next finding's memory heap main line at the trip says whether this was the whole cause. If snapshot-stream is still named there with the heap still spiking, the next step is a heap capture on a copy of production's data (FORGE_HEAP_CAPTURE_DIR).
The stream pass now collects garbage after each forge (
Bun.gc(false)instreamPass,src/snapshot/stream.ts). This is a best guess at the cause, and I could not measure it against production's data.What the evidence says. The main heap went from 595 MiB to 2587 MiB at the trip, then fell back to 513 MiB. No held count rose, so this looks like garbage piling up, not a leak.
snapshot-streamwas the job open across the trip, as on #17205.The suspected cause. A pass over N hosted forges lists the bucket N + 1 times, each listing a
Setof every chunk key. It also cuts every chunk through fresh buffers. The collector let a whole pass's worth build up before it ran. Collecting between forges keeps the peak at one forge's garbage instead of the whole pass's.What changed.
streamPasstakes an optionalsettlehook, defaulting toBun.gc(false), and runs it after each forge whether that forge succeeded or failed.test/snapshot-stream.test.tshas a new test checking thatsettleruns after every forge. That file passes (10 tests) andtscis clean. I did not run the rest of the suite orscripts/fast.ts; the forge's check runs the full suite.docs/features/memory-growth.mdhas a new paragraph on this change, including that it is unmeasured.What I chose not to do. I did not skip the fresh bucket listing before each manifest. It guards against a sweep deleting chunks mid-pass, so removing it is a safety decision for a person.
How to tell if it worked. The next finding's
memory heap mainline at the trip says whether this was the whole cause. Ifsnapshot-streamis still named there with the heap still spiking, the next step is a heap capture on a copy of production's data (FORGE_HEAP_CAPTURE_DIR).Closes #17434