Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Where does the bug appear? Cursor main (browser) process, macOS desktop app
Does this stop you from using Cursor? Yes. It quits unexpectedly several times a day.
Describe the bug
Cursor’s main process runs out of V8 heap and the whole app exits. The existing OOM threads I found are about the renderer; this is the Electron main process (event.process: browser in the crash report).
The report’s v8-oom fields:
| field | value |
|---|---|
| location | Ineffective mark-compacts near heap limit |
| heap limit | 4,096 MB |
| heap used | 3,994 MB (97.5%) |
| old_space | 3,829 MB |
| large-object space | 164 MB |
| malloced / external | 64 MB / 7 MB |
9 of my last 10 launches begin with an OOM report from the previous run (older logs have already rotated, so I can’t say when it started). It happens on both 3.24.9 and 3.24.12.
What I measured
The heap climbs monotonically after a normal start. A fresh launch sits at roughly 100–450 MB (normal GC sawtooth), then enters a runaway phase of ~5–9 MB/s at 60–90% CPU until it hits the limit. I sampled the main process every 10 s using the macOS footprint “app-specific tag 16” region as a heap proxy. It tracked the crash report closely (3,844 MB sampled just before the crash vs 3,994 MB reported). One run:
| time since launch | heap proxy |
|---|---|
| ~3 min | 303 MB |
| ~9 min | 973 MB |
| ~11 min | 1.5 GB |
| ~14 min | 2.7 GB |
No agent activity is needed. During the climb, no agent run was active (the agent-loop wakelock had been released minutes earlier), the hook-call counter was flat, and the app wrote nothing to its logs.
sample of the main process during the climb (5 s):
- three libuv worker threads each ~23% busy in
stat/open/getdirentries64/close, i.e. a recursive filesystem walk through Nodefs - the main thread spends its time in V8 GC tracing (cppgc) and microtask processing
- no JS frames are available from
sample, so I can’t say which code is walking
What I ruled out
- System memory: 48 GB RAM, ~90% free, no swap, no jetsam or kernel panic.
- Chat history size: a fresh launch loads the same ~19 GB
state.vscdband sits at ~300 MB until the climb starts. Archiving doesn’t help either (1,277 of ~1,950 chats are already archived and their data stays in the DB). ai-code-tracking.db: only 59 MB.
Possibly relevant setup
- One very large monorepo workspace with ~20 git worktrees (some under Cursor’s managed worktrees folder, some elsewhere).
- Every session logs
WorktreeCleanupMainService ... Granted cleanup lease ... reason="startup-catchup-worktree-cleanup"and never logs it being released. I can’t tell whether that is the walker. - Every session also reports
WorkingCopyLeakError: Potential working copy LEAK detected, having 513 working copies already. Most frequent owner (258).
Questions
- Is this main-process OOM known? I couldn’t find a matching report.
- Is there a supported way to trace what the main process is walking (or to cap it)?
- What should I capture next? I can take a heap snapshot of the main process if you tell me the preferred method.
Version info
- Cursor 3.24.12 (also reproduced on 3.24.9), Electron 42.10.0
- macOS 26.6.2, Apple M5 Pro (arm64), 48 GB RAM
Steps to Reproduce
Possibly relevant setup
One very large monorepo workspace with ~20 git worktrees (some under Cursor’s managed worktrees folder, some elsewhere).
Every session logs WorktreeCleanupMainService … Granted cleanup lease … reason=“startup-catchup-worktree-cleanup” and never logs it being released. I can’t tell whether that is the walker.
Every session also reports WorkingCopyLeakError: Potential working copy LEAK detected, having 513 working copies already. Most frequent owner (258).
Operating System
MacOS
Version Information
Version info
Cursor 3.24.12 (also reproduced on 3.24.9), Electron 42.10.0
macOS 26.6.2, Apple M5 Pro (arm64), 48 GB RAM
Does this stop you from using Cursor
Yes - Cursor is unusable