Repository navigation
Description
Summary
(measured) On a Linux desktop install running 0.16.0, the desktop process's private memory rose across a session of about three days and 19 hours, with spikes that line up in time with repeated multi-megabyte RPC responses. The in-app profiler raised memory.leak-likely (error, n=6) at 123.1 MB/h, plus related memory.leak-suspect warnings on the desktop process (26 MB/h) and the WebKit webview (14 MB/h).
(inferred) This is not a duplicate of a still-open issue. It is related to closed #360 (same 2.77 MB projects.listEntries size; the Nov 13 React #185 crash, fixed in PR #365 as a hidden-list measurement failure, not a payload cap) and to closed #111 (same desktop memory.leak-suspect fingerprint; Files panel used to re-read the full entry list on every change, fixed as a coalesce in PR #116 / v0.9.4). The Files panel still requests that list with no limit, so a large workspace can still return the whole snapshot.
(measured) Static trace is Verified at be03142dcd9f14378d4357d83ad65d2cf5af513a (origin/main). The same list and history bounds are present on the 0.16.0 tag (2bc143ed). No app, test, or production process was run for this diagnosis. Production data was not read.
Evidence
Each claim is tagged. Times are America/Buenos_Aires.
- (measured) Profiler finding
memory.leak-likely(error, n=6): first seen 15 Oct 2026, last seen 17 Nov 2026 at 09:54, on 0.16.0. Slope 123.1 MB/h, r² 0.22. The low r² means the fit is a poor straight line; the measured pattern is a rising floor plus bursts, not a constant hourly leak. - (measured) Related warnings in the same session: desktop
memory.leak-suspectat 26 MB/h (fingerprint previously filed in closed memory.leak-suspect: Files panel re-reads the whole entry list on every change #111 and memory.leak-suspect: desktop host holds about 5 GB of anonymous memory #79), and WebKitmemory.leak-suspectat 14 MB/h (fingerprint previously filed in closed memory.leak-suspect: desktop webview grows about 50 MB/h without levelling #96). - (measured) Desktop private memory: 161 MB (15 Nov 00:00), 178 MB (16 Nov 06:00), 357 MB (17 Nov 06:00), 455 MB (18 Nov 06:00), 543 MB (18 Nov 15:16). Spikes: 306→761 MB at 16 Nov 12:10, and 689→1,155 MB at 17 Nov 18:02.
- (measured) WebKit private memory rose from 258 MB to 477 MB, mostly on 18 Nov.
- (measured) On 0.15.3, during 13–14 Nov, desktop private memory stayed between 424 and 461 MB. That window is shorter than the 0.16.0 session and started from a higher baseline, so it is not by itself proof that 0.16.0 introduced the growth.
- (measured)
projects.listEntriesreturned 2.77 MB responses (the same size reported in Git Manager: app crashes with React #185 after switching branch and fetching in a large repo #360 on 13 Nov) 38 times on 16 Nov, 94 times on 17 Nov, and 37 times on 18 Nov up to the report. - (measured)
gitManager.getCommitsreturned 4.42 MB responses in bursts at 16 Nov 13:10 and 17 Nov 09:15. - (inferred) The memory spikes and the large-response windows coincide in time. Coincidence is not proof that the decoded payloads were retained.
What the code does (measured, at the SHA above)
projects.listEntriesappliesPROJECT_ENTRIES_MAX_LIMIT(200) only when the caller sendslimit(apps/server/src/workspace/rpc.rs:35,:555–571,ListInputat:1745–1749). With nolimit,index.list(None)returns the whole snapshot (apps/server/src/workspace/search.rs:289–301).- The snapshot itself is capped at
SearchLimits::default().max_entriesof 25,000 (and 16 MiB of index memory) (search.rs:89–98). A full 25,000-entry list can be several megabytes on the wire. 2.77 MB is a plausible size for that cap; the exact entry count of these responses was not recorded. - The Files panel requests that full list with only
{ cwd }— nolimit(apps/web/src/components/files/projectFilesQueryState.ts:34, viafileTreeEntriesinpackages/client-runtime/src/state/projectCommands.ts:96–106). The MCPfiles_listwrapper caps at 200; the UI path does not. gitManager.getCommitspages at most 100 commits and targets 1 MiB of serialized commit JSON (apps/server/src/production/git_manager_rpc.rs:600–613,apps/server/src/git/manager/graph.rs:19–27,:166–261). The target always keeps the first commit, even when that one entry is larger than 1 MiB (graph.rs:25–27,:39–50,:247–250). Subject and body are truncated to 100 KiB;changed_filesis not. A 4.42 MBgetCommitsresponse can be a single first commit with a very large file list. That is a source reading, not a replay of the 4.42 MB payloads.
Hypothesis (unproven)
(guess) Large projects.listEntries and gitManager.getCommits responses are decoded on the desktop and in the webview, and some of that memory is not released after the UI no longer needs the payload. That would explain a rising floor after repeated 2.77 MB file-list reads, and spikes that line up with 4.42 MB history pages.
This is unproven. Other session state (open threads, Git Manager views, caches) could raise the floor without a leak. The 0.15.3 flat window does not isolate the cause.
Suggested investigation
- (measured: missing) Confirm the 2.77 MB
listEntriesmessages are the Files-panelfileTreeEntriespath (nolimit) hitting the 25,000-entry snapshot, including how oftensubscribeEntriestriggers a full re-read. Record entry count andtruncatedfor a few of those responses, not repository content or paths. - (measured: missing) Confirm the 4.42 MB
getCommitspages: commit count, encoded size of the first entry, and size ofchanged_filesversus the 1 MiB page target. If one commit exceeds the target, decide whether that exception should have its own cap (for example, omit or pagechanged_files). - (measured: missing) Attribute the retained memory. Compare desktop and WebKit
process.samplejust after a large response, after closing the Files panel and Git Manager history, and after an hour idle. A JavaScript heap snapshot in the webview would show whether decoded entries or commit pages stay reachable. - (inferred) If investigation confirms unbounded replies or retained payloads, consider: default a page or cap when
listEntriesomitslimit; have the Files panel request a bounded or incremental tree; keepgetCommitspages at or below the documented 1 MiB target including the first commit. - Do not treat the closed Git Manager: app crashes with React #185 after switching branch and fetching in a large repo #360 LegendList crash fix or the memory.leak-suspect: Files panel re-reads the whole entry list on every change #111 coalesce as sufficient. Those left the uncapped Files-panel list in place.
Acceptance criteria
- On a large workspace, after opening the Files panel and Git Manager history long enough to reproduce multi-megabyte
listEntriesandgetCommitsreplies, closing those views returns desktop and WebKit private memory to a near-baseline within a documented bound, or the residual is measured and explained as live state rather than retained payloads. - The Files-panel
listEntriespath is explicitly bounded or paged. An omittedlimitmust not return up to 25,000 entries as a single multi-megabyte reply unless that contract is documented and accepted. -
gitManager.getCommitspages stay at or below the documented 1 MiB target, including the first-commit exception, or that exception has its own hard cap. A 4.42 MB page is no longer a valid result of the current contract. - Focused tests cover the chosen bounds (omitted
listEntrieslimit; a firstgetCommitsentry that would exceed the page target). The usual repo gates pass:cargo fmt, Clippy-D warningson the server targets, the focused tests,vp check, and typecheck. - A delivery note records sizes, counts and durations only, never repository content, paths or personal data.
Related
- #360 (closed, PR Batch: terminal, Git, worktree, update guard, Share this host and crash fixes (#348, #351 to #358, #360 to #362, #366) #365 / in 0.16.0): Git Manager crashed with React Create worktree dialog ignores the Default Agent set in Settings #185 after a branch switch and fetch in a large repo. One
projects.listEntriesreply was 2,770,896 bytes, the same size seen here. The shipped fix guarded a hidden LegendList and added render-error reporting. It did not caplistEntries. Propose a short comment there pointing at this issue once it is filed, not a reopen. - #111 (closed, PR v0.9.4: PR right panel, provider background work, revert, and fixes #116 / v0.9.4): same desktop leak-suspect fingerprint; Files panel re-read the full list on every change (then about 1.24 MB per message). The coalesce shipped; the uncapped full-list request remains. A 2 Nov 2026 comment already noted the fingerprint returning on 0.14.0 with a stepped floor rather than a per-change re-read. Propose a pointer comment after filing, not a reopen.
- #96 (closed): same WebKit leak-suspect fingerprint; later comments already recorded slower growth on later versions. Related, not a duplicate of this 0.16.0 floor-and-spike pattern with the 2.77 MB / 4.42 MB payloads.
- The new
memory.leak-likelyfingerprint in this report has no existing issue. Closed #101 and #272 are other leak findings with different symptoms (Windows agent-turn growth; a false-positive recovery after a memory dip).
Activity
fix: close the open issue batch and the findings its validation showed