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
The serve --service background daemon stays resident 24/7 holding ~700-800 MB RSS with no active sessions and 0% CPU (97% of sample frames in kevent64 wait), which shows up as a permanent memory/energy footprint in Activity Monitor on a 16 GB MacBook Air.
Install/channel: local binary in ~/.opencode/bin, channel next
Active plugins: ~/.config/opencode/plugins.v2/memory.ts (opencode-memory)
Reproduction
Run opencode2 in a terminal (attaches to the serve --service daemon).
Close the TUI session; the daemon remains in the background.
Measure: ps -o pid,rss,pcpu,command -p <daemon-pid> and sample <daemon-pid>.
Observed:
Daemon RSS: ~700-780 MB while idle, 0% CPU
sample: main thread 1676/1729 frames in kevent64 (waiting), all worker threads in _pthread_cond_wait — fully idle but not releasing memory
With an active TUI session (~600 MB) plus MCP children (~350 MB), total opencode2 footprint reached ~2 GB
Expected Behavior
An idle background daemon should hold a much smaller resident footprint (tens of MB), or exit when no sessions are active, or make residency configurable.
Actual Behavior
~700-800 MB RSS stays permanently resident even with no sessions open; macOS Activity Monitor reports it as a persistent energy/memory consumer and the memory is never reclaimed.
Additional Context
Workarounds: opencode2 service stop when not needed, or --standalone mode (private per-session server) to avoid a persistent daemon. Also observed: a leftover TUI session process remained in stopped state (T/SIGSTOP, ~240 MB RSS) after sessions were closed — likely job-control related, but it was not reaped either. Reproduction is consistent: the daemon holds this footprint every day.
This issue might be a duplicate of existing issues. Please check:
Memory Megathread #20695: Memory Megathread — the canonical tracking issue for all memory/RSS-related reports. The megathread also has instructions for capturing heap snapshots, which would be very helpful for diagnosing the idle daemon footprint you're seeing.
If you haven't already, please consider following the heap snapshot instructions in #20695 and uploading a snapshot — that's the most actionable data for the team to diagnose the idle RSS retention.
Activity
github-actions commentedon Aug 13, 2026
This issue might be a duplicate of existing issues. Please check:
opencode serveaccumulates anonymous JS heap — similar idle/long-running daemon RSS retention on a different platform.opencode2RSS grows ~530 MB/min during active agent turn — related V2 memory growth report.If you haven't already, please consider following the heap snapshot instructions in #20695 and uploading a snapshot — that's the most actionable data for the team to diagnose the idle RSS retention.
github-actions commentedon Oct 13, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.