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

The admin profiler leaks memory until the forge crashes: it brought production down for 2.5 minutes #12455

shipped production is serving it opened this has it

Landed in pull #12456 · run

opened this

What happened. 2026-11-14 06:45:44Z to 06:48:09Z the forge (0.7.595) was down: Bun 1.3.14 died with panic: Segmentation fault at address 0x0, RSS: 4.18GB | Peak: 15.99GB, and docker restarted it. Nothing else was wrong; the process normally holds about 1.8 GiB.

Cause, proven on the stage rig. GET /api/v1/admin/profile (src/perf/sample.ts) calls startSamplingProfiler() and never stops it; its own note says "the profiler stays attached until this process restarts". After the window nobody reads the traces, so they pile up. On a copy of production with the same page loads for three minutes:

start+60 s+120 s+180 s
after one 5-second profile905 MiB1,5492,0732,436
no profile (control)1,259 MiB1,1251,1091,119

About 500 MiB a minute under load. On production the first profile of that process was at 06:07Z and it died 38 minutes later at a 16 GiB peak: the same rate.

Ask.

  1. A profile never outlives its window. If this Bun can stop the sampler, stop it. If it cannot, the profile runs somewhere that can be thrown away (a short-lived Worker cannot sample the serving thread, so: prove what works) or the traces are drained and discarded on a named timer for as long as the sampler is attached, with a test on Linux that memory is flat ten minutes after a profile under load.
  2. Until that is proven the endpoint refuses on a forge that serves people, with one sentence saying why and that the stage rig still allows it (FORGE_PROFILE=1). This is a guard for uptime, not for caution: it took the forge down.
  3. The forge's own memory is watched: a serving process that grows past a multiple of its usual size raises a needs-you line with its size and the time it started growing, before it dies.

Done when. The table above, re-run with the fix, is flat in both rows.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs