🐛 Issue: opencode memory usage keeps growing over time #8099

Open
opened 2026-02-16 18:09:10 -05:00 by yindo · 1 comment
Owner

Originally created by @console3 on GitHub (Jan 30, 2026).

Originally assigned to: @rekram1-node on GitHub.

Hi,
I’ve noticed that opencode / opencode-cli consumes an unusually large amount of memory over time, and the usage keeps increasing during normal usage.

At startup, memory usage looks reasonable, but after some time of usage, it grows continuously and does not seem to be released.

Eventually, it reaches multiple GBs, which is not expected for this type of application.

Environment
• OS: macOS (Apple Silicon)
• opencode version: 1.1.47
• Installation method: other
• Running locally, no Docker / VM involved

Observed Behavior
• On startup:
• Memory usage is normal (a few hundred MB)
• After continued usage:
• Memory usage keeps increasing
• No obvious drop after tasks finish
• In some cases:
• opencode-cli reaches 10–15 GB+ memory usage
• Another related process (opencode) also remains resident with hundreds of MB

I’ve attached screenshots from macOS Activity Monitor showing the memory usage over time.

Screenshots
• opencode-cli using ~15.5 GB memory
• Related opencode process still active (~500+ MB)
• Memory usage inc

reases with usage, not immediately on startup

Image Image
Originally created by @console3 on GitHub (Jan 30, 2026). Originally assigned to: @rekram1-node on GitHub. Hi, I’ve noticed that opencode / opencode-cli consumes an unusually large amount of memory over time, and the usage keeps increasing during normal usage. At startup, memory usage looks reasonable, but after some time of usage, it grows continuously and does not seem to be released. Eventually, it reaches multiple GBs, which is not expected for this type of application. ⸻ Environment • OS: macOS (Apple Silicon) • opencode version: 1.1.47 • Installation method: [other](https://opencode.ai/download) • Running locally, no Docker / VM involved ⸻ Observed Behavior • On startup: • Memory usage is normal (a few hundred MB) • After continued usage: • Memory usage keeps increasing • No obvious drop after tasks finish • In some cases: • opencode-cli reaches 10–15 GB+ memory usage • Another related process (opencode) also remains resident with hundreds of MB I’ve attached screenshots from macOS Activity Monitor showing the memory usage over time. ⸻ Screenshots • opencode-cli using ~15.5 GB memory • Related opencode process still active (~500+ MB) • Memory usage inc reases with usage, not immediately on startup <img width="1536" height="437" alt="Image" src="https://github.com/user-attachments/assets/365190b0-e35c-4673-9cc9-52fea92f2ef1" /> <img width="1536" height="298" alt="Image" src="https://github.com/user-attachments/assets/d02d56a7-c9e0-47de-9023-5463d1fd4cd2" />
yindo added the perf label 2026-02-16 18:09:10 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 30, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10913: fix: multiple memory leaks in long-running sessions - Documents specific memory leak sources (AsyncQueue, bash tool unbounded concatenation, LSP diagnostics, bus subscriptions, PTY buffer, process exit handling)
  • #10046: [Release] Uncontrolled Memory Growth Causing System Overload Due to Poor Resource Management - Similar issue about continuous memory growth and resource management failures
  • #9239: High Memory Usage on macOS 15.7 (Apple M4, 16GB, arm64) - Also reports high memory usage on macOS with Apple Silicon

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 30, 2026): This issue might be a duplicate of existing issues. Please check: - #10913: fix: multiple memory leaks in long-running sessions - Documents specific memory leak sources (AsyncQueue, bash tool unbounded concatenation, LSP diagnostics, bus subscriptions, PTY buffer, process exit handling) - #10046: [Release] Uncontrolled Memory Growth Causing System Overload Due to Poor Resource Management - Similar issue about continuous memory growth and resource management failures - #9239: High Memory Usage on macOS 15.7 (Apple M4, 16GB, arm64) - Also reports high memory usage on macOS with Apple Silicon Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8099