opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Absurd amount of cpu and memory usage when doing pah completion

Open MuntasirSZN opened this issue 6 months ago • 13 comments

Its kind of like a forkbomb, I am using github copilot and cpu goes 100% and same for memory, i typed .local/share and its going flames. On latest.

MuntasirSZN avatar Jun 28 '25 10:06 MuntasirSZN

this happens to me as well but only when in my ~home directory. probably just because of the massive number of files and folders it has to search through

Sir-Goose avatar Jun 28 '25 16:06 Sir-Goose

this happens to me as well but only when in my ~home directory. probably just because of the massive number of files and folders it has to search through

Yeah true. Though fzf can do it.

MuntasirSZN avatar Jun 29 '25 02:06 MuntasirSZN

Image

+1, I Open on home directory and type @ and it goes off

jeankvd avatar Sep 22 '25 20:09 jeankvd

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

rekram1-node avatar Dec 28 '25 01:12 rekram1-node

Yep still needed @rekram1-node

MuntasirSZN avatar Dec 28 '25 01:12 MuntasirSZN

Maybe skim can help? Fzf takes a lot of ram. Also other ways can be taken other than using fzf or similar. I think fzf indexes from start on each run. Instead, opencode should maintain a index in the background. This will dramatically decrease ram usage on future runs (first runs will be slow, starting from 0)

MuntasirSZN avatar Dec 28 '25 01:12 MuntasirSZN

what version are you using?

I don't think we use fzf anymore

@MuntasirSZN

rekram1-node avatar Dec 28 '25 01:12 rekram1-node

what version are you using?

I don't think we use fzf anymore

@MuntasirSZN

Latest always... Idk but it may not be fzf anymore, I just looked at internals one day and never rechecked it. Though the issue persists.

MuntasirSZN avatar Dec 28 '25 01:12 MuntasirSZN

related: https://github.com/sst/opencode/issues/2585 seems opencode never releases large files read in memory

scarf005 avatar Dec 28 '25 01:12 scarf005

and u get this issue specifically with “@“? Because otherwise ill close we have a lot of related issues and this one is older

rekram1-node avatar Dec 28 '25 01:12 rekram1-node

I don't have very large files in home dir, they are in hidden dirs like local or cache. I have a lot of small files, that can be said.

MuntasirSZN avatar Dec 28 '25 01:12 MuntasirSZN

But is it specifically hapening when you open the "@" completions bar in the tui?

rekram1-node avatar Dec 28 '25 02:12 rekram1-node

But is it specifically hapening when you open the "@" completions bar in the tui?

Yes, specially in really large folders like home dir.

MuntasirSZN avatar Dec 28 '25 10:12 MuntasirSZN