Public: anyone can read this; the crew can change it.
Sentinel: memory-growth was degraded 14 minutes today: The forge's own memory is 4774 MiB, over twice its first-hour 1779 MiB and past the 2176 MiB more its database caches m… #17860
Merged 28h 29m ago, live in production
Every few minutes, the stream pass that backs up each hosted forge now keeps the bucket's chunk keys in memory once between forges instead of twice. This is a likely cause of the main heap growth in this finding, but not a proven one: it is measured on a local benchmark, not on production's data. Why this spot.
-
Reviews
ApprovedClean. missingChunks walks the fresh listing against only the manifest's keys, so callers in verify.ts and mirror.ts get the same answer in the same order. The check before each manifest is still a fresh listing, so a view that claims a lost chunk fails it, writes no manifest and is dropped. Both new tests cover that and would fail without the change, and the docs entry follows the earlier ones. No page or terminal change, so no door is owed. One nit for a later pass: the comment in takeSnapshot above
const viewed(around line 642) still says the view goes back 'only as the fresh listing below'. It now goes back as the set the forge kept, and the comment should say so. -
Checks
shipped production is serving it deploy 5ce50ab
-
History
- A stream pass holds the bucket's keys once between forges, not twice (#17851) c29a3d2
- A Talk reply names its model, and a turn that reaches its limit says so and offers to go on (#17842) 01d8b2c
- Full suite red: test/page-titles.test.ts (#17847) 63507b9
- The most frequent red checks (client JS/CSS ceilings, batched rows, look prerequisites) are fixed at their cause, no rule loosened (#17836) 339cc69
- /signin answers without a stall on the serving thread (#17835) ff7b4dd
- A run shows which account it took and why, and Settings shows each account's place in the order (#17837) 9b29938
- Talk's context meter uses the model's real window, not 200k (#17841) a1797ca
- Every model call in Talk writes one log line: account, model, seconds, how it ended (#17838) cf3f3e9
- git-upload-pack for a runner job no longer holds the serving thread (#17839) 91265d1
- The maintain duty works in slices and yields to the serving thread (#17840) fadecfc
- resolveAppHostname asks the database once per hostname, not once per call (#17833) cb78eb4
- An app that stops with 'Cannot find module dist/server.js' says why on its page (#17834) 6c2baf3
- Merge pull request #17792 from sold/shell-refusals-2 856fb52
- Merge pull request #17798 from sold/jar-there-later 776f58f
- Talk's Stop stays for the whole answer, with words in the box too (#17819) b51ab2e
- The changelog credits a model only when a run backs it (#17807) e780a4e
- The decider can be compared with SubQ Snap in the background, off by default, and decides nothing (#17795) c0cee92
- small: the '+ New forge' page has one primary next action, with phone and desktop looks on the pull (#17818) 6cc8e61
- GET pulls/:number runs an uncapped diff and renders it on the serving thread (#17812) 153cbb3
- Full suite red: 2 files in check run 01m8wzswcz0vr3fz25ryd619jz (#17814) 8f7dfc4
Every few minutes, the stream pass that backs up each hosted forge now keeps the bucket's chunk keys in memory once between forges instead of twice. This is a likely cause of the main heap growth in this finding, but not a proven one: it is measured on a local benchmark, not on production's data.
Why this spot. The finding has snapshot-stream open across the trip, which also happened in #17434, #17493, #17558 and #17760. The release it came from (bdc702efdbe1) already had all four fixes. The main heap went from 431 MiB in the first hour to 1685 MiB at the trip, and every held count stayed flat. Earlier fixes all made garbage get collected sooner while chunks are being sent. They did nothing for the check before each forge's manifest, which sends nothing. That check built a Set from a fresh listing of the whole bucket while the pass's own view, a Set of the same keys, was still held. So every key was in memory twice, plus the listing's array, and nothing triggered a collection.
What changed (src/snapshot/snapshot.ts):
missingChunksbuilds a smallMapof only the keys the manifest names and goes through the listing deleting them. It no longer makes aSetof the listing. Its unusedlistedcallback is gone. The other two callers,verify.tsandmirror.ts, get the same answer in the same order.takeSnapshothands on theSetit worked from: what it started with plus every chunk it sent. Before, it handed on the fresh listing.- The check before each manifest is still a fresh listing. If the view claims a chunk the store has lost, the forge skips sending it, the check fails, no manifest is written and the view is dropped, so the next forge lists afresh.
Measured off production. I ran four snapshots in a row against a store listing a million chunk keys. Peak main heap was 281 MiB, against 323–575 MiB before. Either way, 146 MiB is held afterwards (the one view). The next finding's memory heap main line at the trip will show whether this was all of it. That note is added to docs/features/memory-growth.md, following the earlier entries.
Tests (test/snapshot-stream.test.ts):
- The view a forge hands on is the same
Setit started from, grown by what it sent. This test fails without the change. - A view that names a chunk the store has lost writes no manifest and leaves the old one in place, drops the view, and the next take sends the chunk again and restores.
Checks. The type check passes, and the gate passes all 32 rules. I ran the snapshot, drill and repo-wide rule tests: 326 pass. scripts/fast.ts named 553 files (about 40 minutes), too broad to run here, so the rest is left to the forge's check.
Not done.
- No paged
liston theStoreinterface. That would keep even the listing's array from being built in one piece, but it changes every store implementation. - No change to the collection thresholds.
- No page or terminal changes, so the commit says
No door.
Review steps (nothing visible changes; this is for reading the next sentinel finding):
[{"go":"/system","look":"Forge memory: the memory-growth need and the main heap figure","expect":"Across a day with stream passes, memory-growth stays out of the degraded list, or the main heap at a trip no longer climbs past ~2x its first hour while snapshot-stream is open"}]
🤖 Generated with Claude Code
Every few minutes, the stream pass that backs up each hosted forge now keeps the bucket's chunk keys in memory once between forges instead of twice. This is a likely cause of the main heap growth in this finding, but not a proven one: it is measured on a local benchmark, not on production's data.
Why this spot. The finding has
snapshot-streamopen across the trip, which also happened in #17434, #17493, #17558 and #17760. The release it came from (bdc702efdbe1) already had all four fixes. The main heap went from 431 MiB in the first hour to 1685 MiB at the trip, and every held count stayed flat. Earlier fixes all made garbage get collected sooner while chunks are being sent. They did nothing for the check before each forge's manifest, which sends nothing. That check built aSetfrom a fresh listing of the whole bucket while the pass's own view, aSetof the same keys, was still held. So every key was in memory twice, plus the listing's array, and nothing triggered a collection.What changed (
src/snapshot/snapshot.ts):missingChunksbuilds a smallMapof only the keys the manifest names and goes through the listing deleting them. It no longer makes aSetof the listing. Its unusedlistedcallback is gone. The other two callers,verify.tsandmirror.ts, get the same answer in the same order.takeSnapshothands on theSetit worked from: what it started with plus every chunk it sent. Before, it handed on the fresh listing.Measured off production. I ran four snapshots in a row against a store listing a million chunk keys. Peak main heap was 281 MiB, against 323–575 MiB before. Either way, 146 MiB is held afterwards (the one view). The next finding's
memory heap mainline at the trip will show whether this was all of it. That note is added todocs/features/memory-growth.md, following the earlier entries.Tests (
test/snapshot-stream.test.ts):Setit started from, grown by what it sent. This test fails without the change.Checks. The type check passes, and the gate passes all 32 rules. I ran the snapshot, drill and repo-wide rule tests: 326 pass.
scripts/fast.tsnamed 553 files (about 40 minutes), too broad to run here, so the rest is left to the forge's check.Not done.
liston theStoreinterface. That would keep even the listing's array from being built in one piece, but it changes every store implementation.No door.Review steps (nothing visible changes; this is for reading the next sentinel finding):
🤖 Generated with Claude Code
Closes #17851