Skip to content

[Bug]: Backend child OOM-crashes 2–3 min after every start on a ~8,900-thread install, during a burst of ~180 branch PR lookups (Windows, 0.1.11) #41160

Closed

Description

@garrettluskey

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On Windows desktop 0.1.11, have a large install: ~8,860 live threads (0 archived), of which ~1,775 are delegated-task threads. 8,192 threads have a branch and 7,269 have a worktreePath, but only 532 of those worktree folders still exist on disk. 17 projects, ~50 git working dirs touched at start. statev2.sqlite is 6.6 GB.
  2. Start T3 Code.
  3. Watch the backend child's private memory in Task Manager.

Expected behavior

The backend starts and stays well below the V8 heap limit. Start-up branch PR lookups are bounded and coalesced per (repo, branch), and threads whose worktree is gone, or that are settled, don't each cost a lookup.

Actual behavior

The backend child climbs from ~1.4 GB to over 5 GB private memory within about a minute (sampled every 8 s: 1407 → 1504 → 2352 → 2772 → 3815 → 4301 → 5347 MB, then 7.6 GB shortly after). It then aborts with FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory (exit code 134), 2–3 minutes after start. The desktop restarts it, and the cycle repeats. From the user's side, "T3 Code keeps restarting".

Crash counts from server-child.log (exit 134, all OOM): 12 on 11-18, 6 on 11-19, 1 on 11-20, 7 on 11-21, 23 on 11-22. On bad days they come in bursts about 5 minutes apart, which is just the start → OOM time.

During the climb, server.trace.ndjson is dominated by branch PR lookups. In the 2 minutes before one OOM:

span count summed duration
runGitCommand 2232 148 s
GitVcsDriver.readConfigValue 731 116 s
lookupBranchPullRequest 181 252 s (max 27.9 s)
resolveLookupHeadContext 181 109 s
findPublishedBranchRemote / findRemoteTrackingRemote / isUnpublishedBranch ~175 each 50–95 s each
ThreadPullRequestServiceV2.resolveProject 180 —

Up to 9 git processes ran at once, across 50 distinct cwds. The main project repo alone took 3,347 git spans in 3 minutes. The lookups' summed memory.heap_growth_bytes is the largest of any span family (lookupBranchPullRequest ≈ 3.7 GB summed over the window), but these numbers are inclusive and overlapping, so I can't prove they retain the heap. I'm reporting them as the dominant start-up activity during the climb, not as a confirmed leak site.

Other start-up noise in the same window: 53× storage cleanup failed for worktree (git worktree remove → fatal: failed to delete '<worktree>'), plus repeated thread branch pull request lookup failed for a repo that no longer exists on GitHub (GitHubApiNotFoundError: Could not resolve to a Repository).

Unlike #40761, this isn't a one-off reading under unusual load. The same start → OOM cycle has repeated across five days (59 OOM aborts in the log), and the failure is a hard heap abort, not just slow git.

Related, not duplicates:

Impact

Blocks work completely

Version or commit

0.1.11 (desktop, stable)

Environment

Windows 11 Pro 26300, T3 Code (Beta) desktop 0.1.11, Git for Windows. Providers: Claude (mostly) plus delegated tasks.

Logs or stack traces

[14668:000001E0004A8000]   182261 ms: Mark-Compact (reduce) 3847.5 (3904.7) -> 3847.5 (3901.2) MB, pooled: 0.0 MB, 1242.98 / 0.00 ms (average mu = 0.025, current mu = 0.002) last resort; GC in old space requested
[14668:000001E0004A8000]   183510 ms: Mark-Compact (reduce) 3847.5 (3901.2) -> 3847.5 (3899.9) MB, pooled: 0.0 MB, 1249.22 / 0.00 ms (average mu = 0.013, current mu = 0.000) last resort; GC in old space requested

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 00007FF7BBCC3186 node::SetAbortHandler+54
 2: 00007FF7BBCC3531 node::OnFatalError+881
 ...
backend child process failure output end  pid=14668 code=134

event-loop-stalls.ndjson before earlier crashes: delayMaxMs 2–9 s, utilization: 1, rssMb 7,400–8,200, 350k–515k major page faults per sample.

Workaround

None confirmed yet. The plan is to bulk-archive old threads, especially delegated-task threads and threads whose worktree folder is gone, to shrink the per-thread lookup set.

Activity

  1. garrettluskey commented on Nov 23, 2026

    @garrettluskey
    Author

    Related feature request with this install's numbers: auto-archive for settled threads, placed next to the "Delete inactive worktrees" setting — #15076 (comment). Without it there's no way to keep the live-thread set (and so the start-up PR lookup fan-out) bounded short of one archive call per thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions