I recently hit a fairly ridiculous issue while running a Next.js app.
My Mac started slowing down badly, and Activity Monitor showed:
Cursor: 50GB+ memory
Chrome: 16GB+ memory
At first, I assumed the app had a memory leak.
I checked the usual suspects:
- React render loops
- leaking
useEffecthooks - timers and listeners without cleanup
- excessive console logging
- large client-side renders
- Next.js cache problems
I also cleared .next, restarted the dev server, restarted Cursor, and checked for unusually large files.
None of that fixed it.
The Actual Cause
Eventually, I noticed that the .cursor directory was nested inside the project instead of sitting at the repository root.
It looked roughly like this:
my-project/
├── app/
│ └── some-folder/
│ └── .cursor/
├── components/
├── package.json
└── next.config.ts
Instead of:
my-project/
├── .cursor/
├── app/
├── components/
├── package.json
└── next.config.ts
I have no idea how it ended up there.
I moved the nested .cursor folder back to the project root, fully restarted Cursor, and the memory usage immediately returned to normal. That was the only change that actually fixed it.
Why This Took So Long to Find
Restarting Cursor had not helped because it was reopening the same project with the same misplaced directory.
The app itself looked guilty because Chrome was also consuming a large amount of memory, so I spent time checking React and Next.js first.
In the end, the problem was not a render loop or some deeply buried application bug.
It was one hidden folder in the wrong place.
Quick Check
Run this from the project root:
find . -type d -name ".cursor"
For a normal single-project repository, you would usually expect:
./.cursor
A deeply nested result is worth investigating.
Be careful with monorepos, because nested configuration may be intentional. Do not move anything blindly.
The Fix
- Find the misplaced
.cursordirectory. - Move it to the repository root.
- Fully quit Cursor.
- Reopen the project.
- Check memory usage again.
In my case, that was enough.
The Lesson
When an editor suddenly starts consuming absurd amounts of memory, do not only inspect the application code.
Also inspect the project structure, especially hidden tool-specific directories.
One misplaced folder caused Cursor to reach more than 50GB of memory and sent me looking for problems that were not there.
Top comments (0)