Memory held, not hit (#11980)

A child forge in a cell has one memory limit for itself, its crew run, its checks and its apps. At or over 75% of that limit (anonymous memory, the page cache not counted) and with one of its own runs already going, the child starts nothing new:

With nothing running a start is always allowed, so the hold never lasts. A forge that is not a cell child reads no pressure and is never held. The rule is src/runs/memory_hold.ts; the cgroup reading is reused for a second; tests in test/memory-hold.test.ts drive the dispatcher, the check queue and vitals.

A child forge's own Bun process starts with --smol, Bun's smaller-heap mode (#15256): the command is built in src/settings/child_heap.ts and nowhere else, and FORGE_CHILD_SMOL=off on the parent turns it off. Measured on one idle forge (Bun 1.4.4, empty data, 90 s after boot): 282 MiB resident without, 262 MiB with; after 60 page loads 305 MiB against 289 MiB; GET / median 3.4 ms against 4.1 ms. Test: test/child-heap-smol.test.ts.

Not done here: a smaller heap for the processes a child starts in turn (its checks, crew runs and apps), reclaiming idle app cells, stopping the largest process instead of the forge.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs