Public: anyone can read this; the crew can change it.

Sentinel: memory-growth was degraded 31 minutes today: The forge's own memory is 5754 MiB, over twice its first-hour 2064 MiB and past the 2176 MiB more its database caches m… #17108

opened this

Merged 41h 42m ago, live in production

This doesn't stop the growth. It makes the next memory-growth finding name the work that was running when it happened, which is the question #17083 can't answer. Why.

Notes

opened this

This doesn't stop the growth. It makes the next memory-growth finding name the work that was running when it happened, which is the question #17083 can't answer.

Why. On 2026-12-01 the memory outside every JS heap went from 1321 MiB to 4536 MiB from 12:26 and was back to 1442 MiB by 14:07. The main heap stayed at about 600–700 MiB, and the database statement cache sat pinned at 1,024 the whole time. So this was native memory held by some piece of work and released when that work ended. It was not the steady climb that #16985 bounded. The finding's evidence couldn't name that work: the per-job tally counts only JS heap growth, and the held counts cover only named collections.

What changed

  • src/perf/jobs.ts: the job watch already tracked jobs started under during that hadn't finished. It now reports them through running(). A new runningOf(app) merges the thread's open jobs with the forge's and gives, for each job name, how many are open and when the oldest started (epoch ms). Oldest first, at most 64 names.
  • src/perf/memory_watch.ts: each minute's reading can carry those open jobs, and the trip keeps them. The finding adds two lines:
    • memory jobs open at the trip: begun since the growth began: …; open before it: …
    • memory jobs open now: …

    "Since the growth began" is measured from the last minute RSS was under 1.25x its first hour. That way a job started just before the first minute over that line counts with the growth, and a long poll open all day is listed apart. Five jobs are named and the rest are counted.

  • src/boards/memory.ts: the minute sampler passes runningOf(app) to the watch.
  • docs/features/memory-growth.md: a paragraph on how to read the new lines. A job open at the trip that is missing from the now line, with RSS back down, is the one to look at.

Not done

  • I couldn't read production's logs or telemetry, so the job behind this spike is still unknown. The next finding should name it.
  • I didn't keep a reading at the peak: the issue's 5754 MiB came after the 4251 MiB trip, and only the trip is kept.
  • I left the mimalloc commit figure alone. It reads 562125 MiB, far above RSS, so it's probably not what its label says, but that's separate from this issue.
  • No door: no page, action, API route or MCP tool changed.

Tests

  • New tests in test/sentinel-memory-evidence.test.ts cover: a job started with the growth is named first and apart from a long poll; a job open since before the last minute under 1.25x is not counted with the growth; the list is capped with the rest counted; nothing open reads none.
  • New test in test/perf-jobs-per-forge.test.ts: runningOf counts open jobs by name on their own forge and drops them once they finish.
  • bun x tsc --noEmit and bun scripts/gate.ts pass (the gate noted one comment line over 100 columns, which its nightly rewrap handles). 209 tests across the memory, sentinel, jobs, unused-exports, hollow and feature-doors files pass. scripts/fast.ts reached 3,964 files, too broad to name, so I picked these myself. I didn't run the full suite; the forge's check runs it on the push.

Try it: a preview never trips the alert, so the new lines are easiest to see by running bun test test/sentinel-memory-evidence.test.ts. On the preview, /system (as an admin) still shows the memory minute lines each minute.

🤖 Generated with Claude Code

Closes #17083

commented

This doesn't stop the growth. It makes the next memory-growth finding name the work that was running when it happened, which is the question #17083 can't answer.

Why. On 2026-12-01 the memory outside every JS heap went from 1321 MiB to 4536 MiB from 12:26 and was back to 1442 MiB by 14:07. The main heap stayed at about 600–700 MiB, and the database statement cache sat pinned at 1,024 the whole time. So this was native memory held by some piece of work and released when that work ended. It was not the steady climb that #16985 bounded. The finding's evidence couldn't name that work: the per-job tally counts only JS heap growth, and the held counts cover only named collections.

What changed

  • src/perf/jobs.ts: the job watch already tracked jobs started under during that hadn't finished. It now reports them through running(). A new runningOf(app) merges the thread's open jobs with the forge's and gives, for each job name, how many are open and when the oldest started (epoch ms). Oldest first, at most 64 names.
  • src/perf/memory_watch.ts: each minute's reading can carry those open jobs, and the trip keeps them. The finding adds two lines:
    • memory jobs open at the trip: begun since the growth began: …; open before it: …
    • memory jobs open now: …

    "Since the growth began" is measured from the last minute RSS was under 1.25x its first hour. That way a job started just before the first minute over that line counts with the growth, and a long poll open all day is listed apart. Five jobs are named and the rest are counted.

  • src/boards/memory.ts: the minute sampler passes runningOf(app) to the watch.
  • docs/features/memory-growth.md: a paragraph on how to read the new lines. A job open at the trip that is missing from the now line, with RSS back down, is the one to look at.

Not done

  • I couldn't read production's logs or telemetry, so the job behind this spike is still unknown. The next finding should name it.
  • I didn't keep a reading at the peak: the issue's 5754 MiB came after the 4251 MiB trip, and only the trip is kept.
  • I left the mimalloc commit figure alone. It reads 562125 MiB, far above RSS, so it's probably not what its label says, but that's separate from this issue.
  • No door: no page, action, API route or MCP tool changed.

Tests

  • New tests in test/sentinel-memory-evidence.test.ts cover: a job started with the growth is named first and apart from a long poll; a job open since before the last minute under 1.25x is not counted with the growth; the list is capped with the rest counted; nothing open reads none.
  • New test in test/perf-jobs-per-forge.test.ts: runningOf counts open jobs by name on their own forge and drops them once they finish.
  • bun x tsc --noEmit and bun scripts/gate.ts pass (the gate noted one comment line over 100 columns, which its nightly rewrap handles). 209 tests across the memory, sentinel, jobs, unused-exports, hollow and feature-doors files pass. scripts/fast.ts reached 3,964 files, too broad to name, so I picked these myself. I didn't run the full suite; the forge's check runs it on the push.

Try it: a preview never trips the alert, so the new lines are easiest to see by running bun test test/sentinel-memory-evidence.test.ts. On the preview, /system (as an admin) still shows the memory minute lines each minute.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs