cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Numerous instances of `rg` spawned, each using 100%+ CPU, until machine slows down to the point of being unusable

Open virgildotcodes opened this issue 10 months ago • 10 comments

Unfortunately I wish I had taken a screenshot, but I didn't.

It's happened to me twice in the last 24 hours, ever since upgrading to .46.

I'm currently on .46.5, and I'm running a 16" M1 Max 32 gig on MacOS 15.3.1.

I first noticed it last night. I was using cursor for a few hours, and suddenly my local web app was taking incredibly long to load page transitions. Very strange. I thought it was something to do with the app itself. A few minutes later, basic actions across the rest of my computer started to lag.

That's when I checked Activity Monitor and noticed that I had maybe a dozen instances of rg running, each consuming 100%+ cpu.

I went through and force quit them all one by one and everything went back to normal.

It happened again a while later, this morning I believe.

Wish I could provide more information, but that's all I've got for now!

virgildotcodes avatar Feb 26 '25 17:02 virgildotcodes

I've also been experiencing this especially when adding large files to context. I'll try reproducing it and reporting back.

iantanwx avatar Feb 27 '25 05:02 iantanwx

Image

ps -u $USER -o comm | sort | uniq -c | sort -nr

i've also included a screenshot of htop

Image

this makes cursor pretty unusable.

closing cursor also immediately kills all instances of rg. restarting doesn't bring them back until i start using agent.

iantanwx avatar Feb 27 '25 05:02 iantanwx

Hi! It looks like the issue here might be from the tailwind extension calling a bunch of vscode APIs to find files in the codebase. Could you try disabling that extension?

https://github.com/getcursor/cursor/issues/1341#issuecomment-2612814777

Zackh1998 avatar Mar 06 '25 06:03 Zackh1998

I am also experiencing the same issue when i am running pnpm i

Image

manos-fr avatar Mar 18 '25 16:03 manos-fr

In my case the issue was caused by a folder with thousands of [unrelated] files, so added .gitgnore and .cursorignore to that folder which fixed the multiple rg's taking up all CPU. On OSX check the process detail in Activity Monitor and see which files the rg process has opened.

fero8 avatar Apr 07 '25 08:04 fero8

I had this issue as well. Running pnpm install was a huge pain because it was spawning countless instances of rg. Have a look at the scrollbar size for this filtered process list – the list is massive:

Image

Interestingly, all the processes that I clicked on were trying to scan my .next/static/chunks folder.

Image

The process was spawned with these args:

...
 /Applications/Cursor.app/Contents/Resources/app/node_modules/@vscode/ripgrep/bin/rg --files --hidden --case-sensitive --no-require-git -g **/*.{ts,tsx} -g !**/.svn -g !**/.hg -g !**/CVS -g !**/.DS_Store -g !**/Thumbs.db -g !**/node_modules/** --no-ignore --no-config --no-ignore-global
..

(got them via ps -ef | grep 'bin/rg')

CPU went completely clogged:

Image

So every time I was running pnpm install, I had to run killall -9 rg in another terminal a couple of times to stop this madness.

After bumping into this thread, I tried disabling TailwindCSS extension as suggested by @Zackh1998. Unfortunately, this did not stop rgs from appearing.


UPD: Looks like in my case the issue was caused by the Auto Import extension. Uninstalling it helped. Found this tip on StackOverflow. Related issue: https://github.com/soates/Auto-Import/issues/127

kachkaev avatar Jul 02 '25 09:07 kachkaev

Removing Auto Import solved the issue for me. 🙏

DZakh avatar Aug 05 '25 14:08 DZakh

Removing Auto Import solved the issue for me. 🙏

I also had a large number of rg processes running, but like you, I solved the problem by deleting the Auto Import extension. Thanks for the helpful information! :)

nabeen avatar Aug 29 '25 09:08 nabeen

I found this issue only yesterday, and I'm not completely sure of what caused it. But I narrowed it down to a single project so most likely due to large files. I didn't have either of the problematic extensions but it still lagged

allen546 avatar Oct 26 '25 02:10 allen546

Same happened to me. SUPER annoying and really disappointing that automatic resource limits are not in place to defend against rogue extensions like this.

aspiers avatar Nov 06 '25 20:11 aspiers

Same happened to my friends...

xsank avatar Nov 18 '25 04:11 xsank