Skip to content

mecatui: small startup-memory wins (mascot decode, retained transients) #2412

Open

Description

@peppescg

Problem

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

  1. Don't memoise the decoded mascot; drop it once the splash is gone (−6 MiB heap).
  2. Embed a ≤ 256 px copy for the half-block path and keep full resolution only for kitty graphics (welcome goldens need updating).
  3. 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).

Acceptance

  • Startup RSS in connect mode drops by ≥ 15 MiB.
  • The splash looks the same (goldens).

Activity

  1. self-assigned this
    on Oct 18, 2026
  2. added
    tuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
    on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions