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
@rexbrahh just leaving it running? Doing nothing? What version of macos are u running then? I have never had that happen
no not idle, for complex prompts where it just works non-stop across several auto compactions which sometimes takes over an hour.
macos tahoe 26.3 beta 1 (always been on developer betas since 26), using opencode on ghostty tip release
Previously I was daily driving codex cli even had several of them working in parallel on git worktrees and it was fine.
I also posted this issue in oh-my-opencode repo which i'm using with opencode. but this issue was already happening before i started using oh-my-opencode.
Also what accompanies this memory issue with opencode and oh-my-opencode is severe input lags. very often it's 30 second + of input lag where the window just freezes -- no scrolling, no keyboard input, no mouse input, etc.
I suspect it's an issue with the bun runtime underneath.
Happening for me too over the last few days.
It gets up to near 10GB after an hour.
I set up another instance of opencode to look at what was happening on the next run and this was its output:
Root Cause Identified:
Metric
Value
Process
PID 33084 (OpenCode)
RAM Usage
~3.8 GB and fluctuating
Session
"Reviewing orphaned entities audit status"
Scope
269,988 additions, 1,132 files
Messages
557 messages, growing
Parts stored
104,863 parts (~3.6 GB on disk)
State
R+ (actively running)
The Problem:
The session is processing a massive code change (270K lines across 1K+ files). OpenCode stores all message history and diffs in memory, causing:
Memory bloat - accumulating all conversation context
Part storage explosion - 105K parts in the filesystem
CPU churn - processing large file diffs repeatedly
Why it may hang:
Context window exhaustion (119K cached tokens visible in messages)
Memory pressure from holding 270K line diffs
Filesystem I/O bottleneck with 65K+ files in single directory
Have to restart opencode once every 1-2 hours or so if prompting continously or my machine OOM's. I think opencode uses bun and bun has severe memory leak issues so likely related?
Activity
github-actions commentedon Dec 26, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rexbrahh commentedon Dec 30, 2025
same here, opencode eats all my ram on macos if i leave it running for like 1 hour + and it just does not kill the memory unless i kill opencode
rekram1-node commentedon Dec 31, 2025
@rexbrahh just leaving it running? Doing nothing? What version of macos are u running then? I have never had that happen
rexbrahh commentedon Dec 31, 2025
no not idle, for complex prompts where it just works non-stop across several auto compactions which sometimes takes over an hour.
macos tahoe 26.3 beta 1 (always been on developer betas since 26), using opencode on ghostty tip release
Previously I was daily driving codex cli even had several of them working in parallel on git worktrees and it was fine.
I also posted this issue in oh-my-opencode repo which i'm using with opencode. but this issue was already happening before i started using oh-my-opencode.
Also what accompanies this memory issue with opencode and oh-my-opencode is severe input lags. very often it's 30 second + of input lag where the window just freezes -- no scrolling, no keyboard input, no mouse input, etc.
I suspect it's an issue with the bun runtime underneath.
navin1976 commentedon Jan 3, 2026
Happening for me too over the last few days.
It gets up to near 10GB after an hour.
I set up another instance of opencode to look at what was happening on the next run and this was its output:
Root Cause Identified:
The Problem:
The session is processing a massive code change (270K lines across 1K+ files). OpenCode stores all message history and diffs in memory, causing:
Why it may hang:
copilotenstar commentedon Mar 22, 2026
Have to restart opencode once every 1-2 hours or so if prompting continously or my machine OOM's. I think opencode uses bun and bun has severe memory leak issues so likely related?
oven-sh/bun#28427