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
Memory leak during long-running session with multiple bash tool calls #33385
Node v26.1.0
Shell fish, inside kitty terminal
RAM 14GB + 14GB swap
CPU AMD Ryzen 7 6800H
description:
During a ~2 hour interactive session involving many consecutive bash tool invocations (setting up a macOS KVM), the opencode process RSS grew monotonically from ~300MB to a peak of 8.6GB (reported by systemd for the parent kitty scope, opencode as dominant child).
The bash subprocess group alone peaked at 468MB, and open_code.db grew to ~70MB. No OOM kill occurred only due to 14GB swap + CachyOS aggressive reclaim. Meanwhile a QEMU VM consuming 4.9GB RSS was also running on the same host, making total pressure ~13.5GB.
No explicit errors in ~/.local/share/opencode/log/opencode.log (1.8MB, 10093 lines).
influence:
Near-OOM on a 14GB host with swap thrashing. Lighter hosts would trigger OOM kill.
guess:
Buffered bash tool output or tool-call history not released between invocations.
Plugins
No response
OpenCode version
1.17.8
Steps to reproduce
Start a long session with heavy tool-call throughput (e.g. quickemu macOS setup)
Make many consecutive bash calls over ~2 hours
Monitor with ps aux --sort=-%mem — RSS grows monotonically
This issue might be a duplicate of existing issues. Please check:
Memory Megathread #20695: Memory Megathread — the central tracking issue for memory problems; maintainers are collecting heap snapshots there to diagnose and fix memory growth issues
If your issue matches what is described in #20695, please consider contributing a heap snapshot there following the instructions in that thread — it would help the maintainers trace and fix the root cause.
Activity
github-actions commentedon Jun 22, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue matches what is described in #20695, please consider contributing a heap snapshot there following the instructions in that thread — it would help the maintainers trace and fix the root cause.