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
This issue might be a duplicate of existing issues. Please check:
High RAM usage in latest release #2805: High RAM usage in latest release - Reports unusually high memory consumption with Bun runtime after recent updates
yeah current performance leaves a LOT to be desired, we are currently rewriting tui and it should be done this week most likely. It will have a lot of performance improvements.
Reacted by 恨鐵不成金, Towry Wang, WTPENGUIN, Kier, JeffJRare, Liam Davis, Luca Nori, Aaron McAdam, Mike Funk and RedAtman
Not sure if relevant to this issue, but one thing I have noticed is that when I run a debugger and either the server or the TUI stays paused on a breakpoint for a while, I would run out of memory on my system within a minute.
Any updates here or suggestions from anyone? In my tiny neovim config directory I am getting large spikes in memory and cpu while streaming in chat responses. I am using WSL.
@rekram1-node if I understand correctly, the rewrite is shipped with v1.0? I'm still experiencing debilitating memory usage caused by opencode starting a ton of lsp servers
their lsp serves different purposes and is only agent invoked afaik so im not surprised, but rust lsp is extremely memory hungry anytime I open rust projects in my ide it swallows a lot.
their lsp serves different purposes and is only agent invoked afaik so im not surprised, but rust lsp is extremely memory hungry anytime I open rust projects in my ide it swallows a lot.
We should figure out how to mitigate this tho..
ah okay understood. would be great to mitigate it, it's only an issue for me on RAM limited VMs as it quickly grows to eat up >16gb
Just here to mention I think I am having the same issue with my opencode version (1.1.51). I tried building with the following Fixes PR #11717 and PR #10914 still doesn't help. I am using an omarchy machine.
I've noticed this too from the first time I tried it. I thought it's just my PC having issues. Now it's been two weeks and i am sure it's opencaude. I am running it in wsl. Honestly, it's very annoying as I have to kill my IDE and restart everything, It will also stop in the middle of the task
If you're running opencode in tmux on Linux, OOM kills are worse than you'd expect. The kernel doesn't just kill opencode. It killed my user systemd, which took tmux and my whole session with it.
I'm capping opencode with a systemd memory scope now. Alias in .zshrc / .bashrc:
# Memory-limit opencode so OOM kills don't take out your sessionalias opencode="systemd-run --user --scope -p MemoryMax=8G -p MemorySwapMax=2G --description=opencode $HOME/.opencode/bin/opencode"
Set MemoryMax to whatever makes sense for your box (I'm on 16G, so 8G). The total ceiling is 10G (8G RAM + 2G swap). If opencode blows past the limit, the cgroup kills it and only it.
Note: if you run multiple opencode sessions, each gets its own 8G cap independently.
Activity
github-actions commentedon Oct 7, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 7, 2025
yeah current performance leaves a LOT to be desired, we are currently rewriting tui and it should be done this week most likely. It will have a lot of performance improvements.
veracioux commentedon Oct 8, 2025
Not sure if relevant to this issue, but one thing I have noticed is that when I run a debugger and either the server or the TUI stays paused on a breakpoint for a while, I would run out of memory on my system within a minute.
I'm guessing this might be because of messages queuing up and/or this code: https://github.com/sst/opencode/blob/c93c0d402d3130c6e69129395993ac1776132234/packages/opencode/src/server/tui.ts#L12
dkmnx commentedon Oct 16, 2025
I'm also experiencing this with
v0.15.3.rekram1-node commentedon Oct 16, 2025
@dkmnx what kind of project is it? Perhaps lsp servers are eating up the memory
dkmnx commentedon Oct 16, 2025
@rekram1-node, its a rust project.
rekram1-node commentedon Oct 16, 2025
@dkmnx is it fixed if you do:
opencode.json
GitMurf commentedon Oct 28, 2025
Any updates here or suggestions from anyone? In my tiny neovim config directory I am getting large spikes in memory and cpu while streaming in chat responses. I am using WSL.
rekram1-node commentedon Oct 28, 2025
rewrite ships soon, hard to say what is causing your issue, maybe dry disabling the lua lsp?
GitMurf commentedon Oct 28, 2025
Oh is it a full rewrite using opentui?
rekram1-node commentedon Oct 28, 2025
Yes, all the go code will be gone all the core logic stays.
hmnd commentedon Nov 13, 2025
@rekram1-node if I understand correctly, the rewrite is shipped with v1.0? I'm still experiencing debilitating memory usage caused by opencode starting a ton of lsp servers
12 remaining items
kanielrkirby commentedon Nov 28, 2025
Happy to test some things if you need in my free time. Otherwise, wish you luck.
LautaroGScholtus commentedon Jan 12, 2026
limit the resources for opencode process
systemd-run --user --pty -p MemoryMax=8G -p CPUQuota=400% opencodeuntil they resolve the memory leak
apekros commentedon Jan 15, 2026
For me yes this resolves it. Otherwise it becomes an unmanageable amount of memory usage.
rekram1-node commentedon Jan 15, 2026
interesting...
apekros commentedon Jan 15, 2026
Claude Code with rust-analyser LSP enabled does not have the same issue, ghostty/nixos if that helps at all either.
rekram1-node commentedon Jan 15, 2026
their lsp serves different purposes and is only agent invoked afaik so im not surprised, but rust lsp is extremely memory hungry anytime I open rust projects in my ide it swallows a lot.
We should figure out how to mitigate this tho..
apekros commentedon Jan 15, 2026
ah okay understood. would be great to mitigate it, it's only an issue for me on RAM limited VMs as it quickly grows to eat up >16gb
KaranjotVendal commentedon Feb 4, 2026
Just here to mention I think I am having the same issue with my opencode version (1.1.51). I tried building with the following Fixes PR #11717 and PR #10914 still doesn't help. I am using an omarchy machine.
broskees commentedon Feb 7, 2026
running into this too ):
AhmedBenyahia commentedon Feb 15, 2026
I've noticed this too from the first time I tried it. I thought it's just my PC having issues. Now it's been two weeks and i am sure it's opencaude. I am running it in wsl. Honestly, it's very annoying as I have to kill my IDE and restart everything, It will also stop in the middle of the task
sjdweb commentedon Mar 12, 2026
If you're running opencode in tmux on Linux, OOM kills are worse than you'd expect. The kernel doesn't just kill opencode. It killed my user
systemd, which took tmux and my whole session with it.I'm capping opencode with a systemd memory scope now. Alias in
.zshrc/.bashrc:Set
MemoryMaxto whatever makes sense for your box (I'm on 16G, so 8G). The total ceiling is 10G (8G RAM + 2G swap). If opencode blows past the limit, the cgroup kills it and only it.Note: if you run multiple opencode sessions, each gets its own 8G cap independently.
thdxr commentedon Apr 2, 2026
Closing in favor of #20695 where we're collecting all memory-related problems. Please follow that issue for updates.