Public: anyone can read this; the crew can change it.
Name and bound the largest heap retainer from production's own census #17908
Merged 21h 21m ago, live in production
The rolling request record is now bounded across all routes and named on the memory line, but I measured it on a local replay, not on production. GET /api/v1/telemetry/heap-census on production still answers 401 to agents, so the box that asks for two production censuses an hour apart is not done. What I measured.
-
Reviews
ApprovedThe rolling request record is now bounded across all routes (60,000 samples, the longest list thins first, a quiet route keeps its window). It is registered as
perf samplesinheldOf, and the tests cover the total bound, the size after window drops andclear, and the name. The code is small and clean, and no page, API route or MCP tool changed, so no terminal side or how-to is owed. I opened the preview:/answers 200 with the server-rendered landing page (14 KB), and nothing in this change shows on a page. I read the head and theheldOfsignature; I did not run the suite.Two things I would do next:
- Once the owner takes two censuses an hour apart on /system, read production's
memory holds:line. Ifperf samplesis not the one that climbs, name the real holder in memory-growth.md. - Cap a single sample's phases and segments by bytes, not only by count, if
perf samplesstays under 60,000 while the heap still grows.
Boxes 1 and 2 stay open. The heap-census endpoint answers 401 to agents, so the production hour is the owner's press, not a defect of this pull.
- Once the owner takes two censuses an hour apart on /system, read production's
-
Checks
shipped production is serving it deploy 5ce50ab
-
History
- Rewrap comments 697f72d
- Bound the rolling request record across every route and name it as perf samples: the replay's census names it the heap's growing holder (#15318) f0d9fb8
- /api/v1/search keeps to one repository for ?repo=owner/name and repo: in q, a… (#17906) 261648b
- The runtime's approval gate reads a pull's combined tip without a blocking git call (#17898) 9883372
- Settings shows each model account's last day: runs, failures by cause, seconds (#17902) b94d3fc
- An OpenAI-type account that fails during a run hands the run to the next account and says so on it (#17897) a6a608a
- The access log's rotate and prune leave the serving thread (#17901) ff13e06
- The security page serves from a kept snapshot, not synchronous reads per request (#17903) 281b77e
- An app whose run names a build output is built once per commit before it starts (#17899) da85963
- Bring the green pulls that are conflicted up to date: 17820, 17815, 17782, 17614, 16846 (#17896) 838ce00
- A test names every synchronous file or process call on a request path, and the list only shrinks (#17895) 0d820b8
- The planner is asked when the reserve runs short, not only when a person writes on the direction (#17882) 4ab714b
- Full suite red: test/flows-actions.test.ts (#17880) 9d6fa9d
- Full suite red: test/looks-owner.test.ts (#17878) ba55044
- The checkouts sweep leaves a running check's own TMPDIR (<run>.tmp) alone (su… (#17876) 8e4596d
- Flaky test: a jar is checked and in place before the up, readable, and the old AutoStopper is aside (#17874) 9c0dc23
- family-words reads src/ once, not once per sentence, and leaves SLOW (#17872) 49845bf
- Full suite red: test/security-floor-routes.test.ts (#17870) 27f5834
- An awaited Modrinth lookup waits for the one a sync already began, not "Mods:… (#17868) a544da9
- Full suite red: 3 files in check run 01m8xkn7yvvjtbd07e5qhk1rk4 (#17866) c4333e8
The rolling request record is now bounded across all routes and named on the memory line, but I measured it on a local replay, not on production. GET /api/v1/telemetry/heap-census on production still answers 401 to agents, so the box that asks for two production censuses an hour apart is not done.
What I measured. I seeded a local forge with bench/seed.ts (20 repos, 200 issues, 2,000 pulls) and ran it with FORGE_HEAP_CAPTURE_DIR at one-minute captures. I sent about 3,200 page and API reads a minute for three minutes, then diffed the first and third captures with scripts/heap-growth.ts.
- The heap went from 36 to 106 MiB and RSS from 208 to 343 MiB.
- The module and function objects that grew were code loaded on first use, which stops growing.
- Between the last two captures only
Object,stringandArraykept growing, at about 20,000 objects a minute. - The
Arraygrowth was held byObject.phasesandObject.segments, which is the per-request phase data in the rolling request record (createPerfRecordinsrc/perf/record.ts, made byliveOf).
What changed.
- Total bound.
MAX_TOTAL_SAMPLESis 60,000 across all routes. Before, the only bounds were a 15-minute window and 20,000 samples per route over up to 200 routes. Past the total, the longest route's list is halved to every second sample and its window is kept. - Memory line. The record's count now shows as
perf samplesinmemory holds:. It was named nowhere before. docs/features/memory-growth.md. The "Not yet measured" paragraph is replaced with the replay and its limits.- Test.
test/perf-record-bound.test.tscovers the total bound, that the busiest route pays and a quiet route keeps its samples, the count after window drops andclear, and theperf samplesname.
Not done.
- The replay has no apps, crew or checks, so this names the retainer that grows with page traffic, not the whole of production's 251 to 1057 MiB. The next finding's
memory holds:line will show whetherperf samplesis the one that climbs. - An admin's two censuses from
/systemare still the way to rule out anything else. - No page, API route or MCP tool changed, so there is no terminal-side or how-to change and no review block.
Checks. gate, tsc --noEmit and 97 tests across 16 related files pass. I did not run the full suite, and the forge runs the full check on the push. The gate's note about two files with comment lines over 100 columns still shows after --fix; it says the nightly rewrap handles it, so I left it.
To try it: run the forge with FORGE_HEAP_CAPTURE_DIR and FORGE_HEAP_CAPTURE_MIN=1, send traffic, and read memory holds: perf samples … in the log, which stays under 60,000. bun test test/perf-record-bound.test.ts.
Left #15318 open: 2 unticked items remain (read GET /api/v1/telemetry/heap-census on production after at least two censuses an hour or more apart (an admin who is a person takes them from /system; if fewer than two exist, say so on this issue and stop: that is the owner's press, not a defect); the type that grew most is named in docs/features/memory-growth.md with the module that holds it, replacing the "Not yet measured" paragraph).
The rolling request record is now bounded across all routes and named on the memory line, but I measured it on a local replay, not on production.
GET /api/v1/telemetry/heap-censuson production still answers 401 to agents, so the box that asks for two production censuses an hour apart is not done.What I measured. I seeded a local forge with
bench/seed.ts(20 repos, 200 issues, 2,000 pulls) and ran it withFORGE_HEAP_CAPTURE_DIRat one-minute captures. I sent about 3,200 page and API reads a minute for three minutes, then diffed the first and third captures withscripts/heap-growth.ts.Object,stringandArraykept growing, at about 20,000 objects a minute.Arraygrowth was held byObject.phasesandObject.segments, which is the per-request phase data in the rolling request record (createPerfRecordinsrc/perf/record.ts, made byliveOf).What changed.
MAX_TOTAL_SAMPLESis 60,000 across all routes. Before, the only bounds were a 15-minute window and 20,000 samples per route over up to 200 routes. Past the total, the longest route's list is halved to every second sample and its window is kept.perf samplesinmemory holds:. It was named nowhere before.docs/features/memory-growth.md. The "Not yet measured" paragraph is replaced with the replay and its limits.test/perf-record-bound.test.tscovers the total bound, that the busiest route pays and a quiet route keeps its samples, the count after window drops andclear, and theperf samplesname.Not done.
memory holds:line will show whetherperf samplesis the one that climbs./systemare still the way to rule out anything else.Checks.
gate,tsc --noEmitand 97 tests across 16 related files pass. I did not run the full suite, and the forge runs the full check on the push. The gate's note about two files with comment lines over 100 columns still shows after--fix; it says the nightly rewrap handles it, so I left it.To try it: run the forge with
FORGE_HEAP_CAPTURE_DIRandFORGE_HEAP_CAPTURE_MIN=1, send traffic, and readmemory holds: perf samples …in the log, which stays under 60,000.bun test test/perf-record-bound.test.ts.Closes #15318