Too high memory usage #3630

Open
opened 2026-02-16 17:40:56 -05:00 by yindo · 6 comments
Owner

Originally created by @klonuo on GitHub (Dec 17, 2025).

Originally assigned to: @rekram1-node on GitHub.

Image

If it's of importance I start opencode web, then attach through CLI

The session wasn't too long, but I ended it when I saw RAM usage

Originally created by @klonuo on GitHub (Dec 17, 2025). Originally assigned to: @rekram1-node on GitHub. <img width="1920" height="982" alt="Image" src="https://github.com/user-attachments/assets/fbe95449-ddfd-4e9d-be3d-d0ba77b75e71" /> If it's of importance I start opencode web, then attach through CLI The session wasn't too long, but I ended it when I saw RAM usage
yindo added the perf label 2026-02-16 17:40:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 17, 2025):

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

  • #5363: opencode eating 70gb of memory?
  • #3995: Single opencode session is consuming 23+GB of memory
  • #3013: Uses a huge amount of memory
  • #4315: Memory stays unbounded: ACP session map + compacted tool outputs
  • #2805: High RAM usage in latest release

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

@github-actions[bot] commented on GitHub (Dec 17, 2025): This issue might be a duplicate of existing issues. Please check: - #5363: opencode eating 70gb of memory? - #3995: Single opencode session is consuming 23+GB of memory - #3013: Uses a huge amount of memory - #4315: Memory stays unbounded: ACP session map + compacted tool outputs - #2805: High RAM usage in latest release Feel free to ignore if none of these address your specific case.
Author
Owner

@klonuo commented on GitHub (Dec 17, 2025):

I wanted to comment that while interacting with model opencode accumulates memory with each interaction, and it seems it will go like that indefinitely

One workaround for Windows users is to use opencode under WSL and to limit WSL memory, that way everything stays under control

@klonuo commented on GitHub (Dec 17, 2025): I wanted to comment that while interacting with model opencode accumulates memory with each interaction, and it seems it will go like that indefinitely One workaround for Windows users is to use opencode under WSL and to limit WSL memory, that way everything stays under control
Author
Owner

@shahidshabbir-se commented on GitHub (Dec 24, 2025):

Image

With one instance - using 5GB of ram

@shahidshabbir-se commented on GitHub (Dec 24, 2025): <img width="1578" height="56" alt="Image" src="https://github.com/user-attachments/assets/ac66b3eb-4a5d-466d-b39d-e26d1c6e73c6" /> With one instance - using 5GB of ram
Author
Owner

@ck3mp3r commented on GitHub (Dec 30, 2025):

This is going to be a show stopper for me soon. 6GB... is there some hidden JVM process you are not telling us about 😆
Joking aside, this needs fixing before it gets worse. It is already borderline...

@ck3mp3r commented on GitHub (Dec 30, 2025): This is going to be a show stopper for me soon. 6GB... is there some hidden JVM process you are not telling us about 😆 Joking aside, this needs fixing before it gets worse. It is already borderline...
Author
Owner

@gamunu commented on GitHub (Dec 30, 2025):

I have noticed this as well.

Image

What I noticed is Most threads are idle or waiting (__ulock_wait2, kevent64, pthread_cond_wait). The memory is allocated and retained, not actively being used by hot code paths.

I was running opencode for about 39 hours

sample-opencode.txt

I attached a sample, I'm not sure how much that will be useful. Will also try with inspect if possible

@gamunu commented on GitHub (Dec 30, 2025): I have noticed this as well. <img width="919" height="85" alt="Image" src="https://github.com/user-attachments/assets/bb0656b1-7d90-4d82-a7e4-cacaf05cec93" /> What I noticed is Most threads are idle or waiting (__ulock_wait2, kevent64, pthread_cond_wait). The memory is allocated and retained, not actively being used by hot code paths. I was running `opencode` for about 39 hours [sample-opencode.txt](https://github.com/user-attachments/files/24381482/sample-opencode.txt) I attached a sample, I'm not sure how much that will be useful. Will also try with inspect if possible
Author
Owner

@dwat27 commented on GitHub (Jan 11, 2026):

she is back again !

Image

Version 1.1.12

@dwat27 commented on GitHub (Jan 11, 2026): she is back again ! <img width="706" height="114" alt="Image" src="https://github.com/user-attachments/assets/6868cd85-e13a-4a10-8f2c-64b0df2c378d" /> Version 1.1.12
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3630