Public: anyone can read this; the crew can change it.
Sentinel: memory-growth was degraded 16 minutes today: The forge's own memory is 4769 MiB, over twice its first-hour 1716 MiB and past the 2176 MiB more its database caches m… #17494
Merged 21h 1m ago, live in production
A snapshot now collects garbage every 256 MiB of plain bytes it reads, not once per hosted forge. This is my best reading of the cause, not a measured one. I did not check it against production's data.
-
Reviews
ApprovedPreview opened:
/answers 200 with the server-rendered landing page (title "Software you ask for, reviewed and shipped", viewport meta set). The change is backend-only, so the page looks the same as before and boots fine with it.Small, scoped change: takeSnapshot now runs Bun.gc(false) every 256 MiB of plain bytes read, with settle/settleBytes as test seams. The test covers both sides (fires with settleBytes 1, never with 2**40). The how-to paragraph is in docs/features/memory-growth.md, not README. No page or terminal surface is touched, so the both-doors rule does not apply. No new dependency and no added cap or hold. The collection is a non-blocking request, so the forge does not stall.
Two things I would do next:
- Read the next finding's
memory heap mainline at the trip. The cause is a reading, not a measurement. If snapshot-stream is still open with the heap high, look at packChunk, as the author says. - If the heap still peaks, log the collection count and the heap before and after a pass, so the evidence shows whether the 256 MiB step is right.
- Read the next finding's
-
Checks
shipped production is serving it deploy 5fa2c54
-
History
- A snapshot collects each 256 MiB it reads, so one big forge's pass does not pile the main heap (#17493) 7421830
- Full suite red: test/bet-wallet-refusal.test.ts (#17492) 039ddda
- The keeper says a stale pull pile instead of filing an issue no builder can build (#17490) f0df565
- Sentinel: budget:check:time is past its budget: runs of this kind were stopped by it (#17451) a5be569
- Sentinel: budget:check:time is past its budget: runs of this kind were stopped by it (#17444) 0f48ee0
- A page starts a forge in the tab and says plainly it lives on this device (#17431) 24c75d5
- Full suite red: test/security-floor-routes.test.ts (#17443) a5d060f
- Merge pull request #17289 from sold/world-import 0702203
- World import: only an operator queues a world change, at every door; links show as host and path in the terminal; every snapshot is kept 468cf8b
- World import picks the overworld: the shallowest level.dat outside a _nether or _the_end folder. On Linux find lists in disk order, and took hub-world_nether's level.dat for the world (the check's runner showed it: world/level.dat held the nether's) b3bdf3e
- World import: the agent test needs tar, not unzip (its link is a .tar.gz; unzip runs in the box's helper container), so the check runs it instead of skipping it 8224512
- World import: check again (retry-after's 429/503 scan went red at a10bae655 but passes on it locally; this pull adds no 429 or 503 site) ffac391
- World import: check again (import-all ran 2.29 s against its 2 s budget on a loaded runner) 7f7f307
- A world with no snapshot yet says so from the empty-words table 78b4d19
- Games: import a world from a link, with a snapshot of the world it replaces, Restore and Undo (#17284 G2) 280333f
- Merge pull request #17295 from sold/game-people b50a2de
- People: a head's misses and fetches out are the app's, kept by app in a WeakMap, not the process's (#12569) 3423c7c
- People: log facts only after the server's own line head, heads only for players the forge has seen, a move only to a server the person operates (#17295 review) 6bb0e56
- People: the head picture route is named among the patterns the seed cannot fill 8fcc7cf
- Games: the network as a picture on /games/<box>: the proxy, its servers awake, waking, asleep or stopped, their TPS and who is on them, and Move by a player's head (#17284 G5) 05e8f63
A snapshot now collects garbage every 256 MiB of plain bytes it reads, not once per hosted forge. This is my best reading of the cause, not a measured one. I did not check it against production's data.
Why this and not something else. At the trip the main heap was 2855 MiB, against 416 MiB in the first hour and 462 MiB now. It fell back, so it was garbage rather than a leak, and every held count was flat. snapshot-stream was open before the growth began. The last fix (#17434) collected once after each forge's pass, but one multi-GiB forge still cuts all its chunks through fresh buffers before that collection runs. verify-sweep is only listed as running at the trip. Nothing in the evidence points at it.
What changed
src/snapshot/snapshot.ts:takeSnapshotcallssettle(Bun.gc(false)) each timesettleBytes(default 256 MiB) more plain bytes have been read. Both are test seams onSnapshotter. The nightly snapshot takes the same path, so it collects the same way.test/snapshot-stream.test.ts: the new test fails without the change.- With
settleBytes: 1,settleruns. - With
settleBytes: 2 ** 40, it never runs.
- With
docs/features/memory-growth.md: a paragraph recording the change.
The snapshot test files other than test/snapshot-stream.test.ts (which passes, 11 of 11) had one failure in my first run that I never identified. That run included my own test failing on a 1 << 40 shift bug, which I fixed and re-ran only in test/snapshot-stream.test.ts. The full suite was not run here; the forge's check runs it. bun x tsc --noEmit was clean, and scripts/gate.ts --fix changed nothing.
What I chose not to do
- No change to the finding's evidence lines or the sentinel.
- No page or terminal change, so the commit says "No door".
- I found nothing in
verify-sweepto change.
How to check. The next memory-growth finding's memory heap main line at the trip shows whether this was the whole cause. If snapshot-stream is still open then with the heap high, the next place to look is the chunk packing in packChunk.
🤖 Generated with Claude Code
A snapshot now collects garbage every 256 MiB of plain bytes it reads, not once per hosted forge. This is my best reading of the cause, not a measured one. I did not check it against production's data.
Why this and not something else. At the trip the main heap was 2855 MiB, against 416 MiB in the first hour and 462 MiB now. It fell back, so it was garbage rather than a leak, and every held count was flat.
snapshot-streamwas open before the growth began. The last fix (#17434) collected once after each forge's pass, but one multi-GiB forge still cuts all its chunks through fresh buffers before that collection runs.verify-sweepis only listed as running at the trip. Nothing in the evidence points at it.What changed
src/snapshot/snapshot.ts:takeSnapshotcallssettle(Bun.gc(false)) each timesettleBytes(default 256 MiB) more plain bytes have been read. Both are test seams onSnapshotter. The nightly snapshot takes the same path, so it collects the same way.test/snapshot-stream.test.ts: the new test fails without the change.settleBytes: 1,settleruns.settleBytes: 2 ** 40, it never runs.docs/features/memory-growth.md: a paragraph recording the change.The snapshot test files other than
test/snapshot-stream.test.ts(which passes, 11 of 11) had one failure in my first run that I never identified. That run included my own test failing on a1 << 40shift bug, which I fixed and re-ran only intest/snapshot-stream.test.ts. The full suite was not run here; the forge's check runs it.bun x tsc --noEmitwas clean, andscripts/gate.ts --fixchanged nothing.What I chose not to do
verify-sweepto change.How to check. The next
memory-growthfinding'smemory heap mainline at the trip shows whether this was the whole cause. Ifsnapshot-streamis still open then with the heap high, the next place to look is the chunk packing inpackChunk.🤖 Generated with Claude Code
Closes #17493