You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mecatui: small startup-memory wins (mascot decode, retained transients) #2412
Beyond the embedded daemon (#2408), mecatui's startup RSS (~110 MiB in connect mode) includes avoidable memory:
Mascot:welcome/embed.go keeps the decoded mascot image for the whole process lifetime (mascotOnce): ~6 MiB of heap, used only by the splash. The half-block path also decodes the full-resolution image (another ~6 MiB transient plus file pages).
Retained startup transients: startup allocates 52–58 MB of short-lived data (13 MB in a minimal client), and the Go runtime keeps ~18 MiB of it as idle heap.
Proposal
Don't memoise the decoded mascot; drop it once the splash is gone (−6 MiB heap).
Embed a ≤ 256 px copy for the half-block path and keep full resolution only for kitty graphics (welcome goldens need updating).
Return startup transients to the OS: call debug.FreeOSMemory() once after the first frame (estimated −10 to −20 MiB at startup), or set a lower GOGC (GOGC=50 measured −7 MiB at startup, with ~2× the GCs).
Activity