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
High CPU (110%) and memory (2GB) with low context usage (16%) after long session #34226
Update: this is reproducible across multiple sessions, not just a one-off. The computer gets noticeably hot every time opencode runs, even in shorter sessions.
This issue might be a duplicate of or related to existing issues. Please check:
Memory Megathread #20695: Memory Megathread — a dedicated thread for tracking and resolving memory growth issues in opencode. The maintainers are actively collecting heap snapshots there to diagnose exactly this kind of problem (high memory after long sessions). Consider following the instructions in that thread to capture and upload a heap snapshot, which would directly help the team investigate your report.
I've captured heap snapshots following the Memory Megathread instructions (manual Ctrl+P flow).
Files generated:
server.heapsnapshot (100 MB)
tui.heapsnapshot (58 MB)
Heap analysis summary:
Metric
server
tui
Total nodes
1,670,688
916,586
Self size
154.7 MB
99.4 MB
Objects
924k
342k
Closures
388k
246k
Strings
90k
106k
Notable findings:
2.6M total objects across both processes — each GC mark-sweep cycle must traverse this entire graph
634k closures — closures retain enclosing scope references, a common leak source
33.5 MB ArrayBuffer — single large buffer potentially leaked
Duplicate system prompts — same prompt strings stored multiple times (15-32 KB each)
Multiple 500KB+ WeakMaps — large key-value stores not being released
This directly explains the CPU spikes: the massive object graph (2.6M nodes) means V8's concurrent GC threads are constantly working even when idle, and each GC pause grows longer as the heap accumulates.
Will upload the snapshots to the Dropbox link shortly (network restrictions on my end). Let me know if there's an alternative upload method available.
Activity
aaabyf commentedon Jun 27, 2026
Update: this is reproducible across multiple sessions, not just a one-off. The computer gets noticeably hot every time opencode runs, even in shorter sessions.
github-actions commentedon Jun 27, 2026
This issue might be a duplicate of or related to existing issues. Please check:
aaabyf commentedon Jun 27, 2026
I've captured heap snapshots following the Memory Megathread instructions (manual Ctrl+P flow).
Files generated:
server.heapsnapshot(100 MB)tui.heapsnapshot(58 MB)Heap analysis summary:
Notable findings:
This directly explains the CPU spikes: the massive object graph (2.6M nodes) means V8's concurrent GC threads are constantly working even when idle, and each GC pause grows longer as the heap accumulates.
Will upload the snapshots to the Dropbox link shortly (network restrictions on my end). Let me know if there's an alternative upload method available.
github-actions commentedon Aug 27, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.