High CPU usage (100% single core) during TUI rendering #7933

Open
opened 2026-02-16 18:08:42 -05:00 by yindo · 4 comments
Owner

Originally created by @alibert99 on GitHub (Jan 29, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Environment:

  • OpenCode version: 1.1.41
  • OS: Ubuntu 22.04 (Linux)
  • Terminal: VSCode Remote SSH terminal
  • Runtime: Bun
    Problem:
    Single CPU core hits 100% when OpenCode is running, even during idle/loading states.
    Diagnosis:
  • strace shows 99.94% time spent in futex() calls
  • Worker thread (TID 971375) consuming 67% CPU
  • Thread is reading from timerfd and constantly waking HeapHelper threads
  • Appears to be a busy-loop in TUI refresh cycle
    strace output:
    futex(0x78d0050ac160, FUTEX_WAKE_PRIVATE, 1) = 1
    (repeats thousands of times per second)
    Expected:
    CPU should be near 0% when idle/waiting for input.

Plugins

No response

OpenCode version

1.1.41

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

ubuntu 22.0.4

Terminal

VsCode

Originally created by @alibert99 on GitHub (Jan 29, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description **Environment:** - OpenCode version: 1.1.41 - OS: Ubuntu 22.04 (Linux) - Terminal: VSCode Remote SSH terminal - Runtime: Bun **Problem:** Single CPU core hits 100% when OpenCode is running, even during idle/loading states. **Diagnosis:** - strace shows 99.94% time spent in futex() calls - Worker thread (TID 971375) consuming 67% CPU - Thread is reading from timerfd and constantly waking HeapHelper threads - Appears to be a busy-loop in TUI refresh cycle **strace output:** futex(0x78d0050ac160, FUTEX_WAKE_PRIVATE, 1) = 1 (repeats thousands of times per second) **Expected:** CPU should be near 0% when idle/waiting for input. ### Plugins _No response_ ### OpenCode version 1.1.41 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System ubuntu 22.0.4 ### Terminal VsCode
yindo added the opentuibugperf labels 2026-02-16 18:08:42 -05:00
Author
Owner

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

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

  • #11109: TUI rendering glitches: overlapping panels, misaligned content, and corrupted layout (related TUI rendering issues that may be caused by the same busy-loop)
  • #11115: OpenCode VS Code Extension: Great UI but severe lag on scroll translation + no pagination scrollbar (performance/lag related issue)
  • #10965: bug: apply_patch waits for LSPs sequentially causing big multi-file patches to hang (related performance/blocking issue in TUI)

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

@github-actions[bot] commented on GitHub (Jan 29, 2026): This issue might be a duplicate of existing issues. Please check: - #11109: TUI rendering glitches: overlapping panels, misaligned content, and corrupted layout (related TUI rendering issues that may be caused by the same busy-loop) - #11115: OpenCode VS Code Extension: Great UI but severe lag on scroll translation + no pagination scrollbar (performance/lag related issue) - #10965: bug: apply_patch waits for LSPs sequentially causing big multi-file patches to hang (related performance/blocking issue in TUI) Feel free to ignore if none of these address your specific case.
Author
Owner

@alibert99 commented on GitHub (Jan 29, 2026):

I confirm high CPU usage (100% one core) related to TUI. strace shows a busy loop on timerfd reads by the Worker thread.

@alibert99 commented on GitHub (Jan 29, 2026): I confirm high CPU usage (100% one core) related to TUI. strace shows a busy loop on timerfd reads by the Worker thread.
Author
Owner

@Junyi-99 commented on GitHub (Jan 29, 2026):

same here, the iTerm2 is using 45% CPUs when opencode is running

Image

When opencode is not running, the CPU usage backs to 4.2%

Image

However, when I switch to Ghostty, the cpu usage drops down to 9.8%

Image
@Junyi-99 commented on GitHub (Jan 29, 2026): same here, the `iTerm2` is using `45%` CPUs when opencode is running <img width="1512" height="946" alt="Image" src="https://github.com/user-attachments/assets/8b348173-ef91-481e-9ff3-ec529c5b5ade" /> When opencode is not running, the CPU usage backs to 4.2% <img width="1512" height="950" alt="Image" src="https://github.com/user-attachments/assets/eb32510e-e805-4a05-90d9-6d2ebbfbfb1e" /> However, when I switch to `Ghostty`, the cpu usage drops down to `9.8%` <img width="1494" height="947" alt="Image" src="https://github.com/user-attachments/assets/a4d87a4d-2af8-4485-b9d2-f8f16f755436" />
Author
Owner

@unphased commented on GitHub (Jan 30, 2026):

Image

Something is definitely going on here.

Nevermind, I think these are from stale dead tmux split instances from oh-my-opencode v3.1.2

@unphased commented on GitHub (Jan 30, 2026): <img width="831" height="380" alt="Image" src="https://github.com/user-attachments/assets/c72614ae-4d8e-4354-98e8-7ba74164c914" /> ~Something is definitely going on here.~ Nevermind, I think these are from stale dead tmux split instances from oh-my-opencode v3.1.2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7933