M9 step 1: memory cheap wins (S9) #3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blocks: #10
Split out of M9: S9 found the trigger already holds, but these cheap fixes come before any parking. Rerun the S9 benchmark afterwards.
From PLAN.md, section "M9: parking (scale)".
first fix. See spikes/s9-memory.
panes: 172 MB; 500: 1.6 GB, with 5 threads per pane). Shims and bash add
about 1.7 MB more, so 500 idle shells cost about 2.5 GB in all.
33 MB per pane, and the 64 MiB cap is about 160 MB.
closed down to 1 still hold 191 MB.
gives every thread: 1.3 MB per pane. It's a one-line patch
(
ghostty-no-signal-stack.patch) to carry and send upstream.ReleaseFast plus the patch measured 0.48 MB per idle pane, which already
meets M9's done bar. But ReleaseFast drops safety checks on untrusted
program output, so it's a decision (open); an upstream fix that avoids
the fill would remove the trade.
malloptat startup, or anotherallocator) and call
malloc_trimafter a pane closes. That saves about13 MB per pane at 10k lines, and memory comes back.
Ring::pushextendsbefore draining. Set it to 1 MiB (replay never uses more than
MAX_REPLAY_BYTES) and drain first.pane). Full history is on disk.
binary instead of re-running the 21 MB daemon (about 0.3 GB at 500
panes).
S9 found nothing that argues for PTY or client-buffer parking. Parking
can't save the shells and shims either (0.75–0.87 GB at 500 panes).
burst, and up to about 64 MB per client from the 1,024-frame queue. Cap the
queue in bytes, not frames.
bench.pyat 50 idle panes (3.07–3.11 MB per paneover four runs) is the regression test M9 wants. Leave headroom.