Repository navigation
F# sidecar releases referenced entities on reload and trim, and budgets swapped-out heap (#566) - #620
Open
MelbourneDeveloper wants to merge 2 commits into
Open
MelbourneDeveloper wants to merge 2 commits into
MelbourneDeveloper wants to merge 2 commits into
Conversation
…ts swapped-out heap (#566) The entity cache kept FCS symbols across workspace reloads; each holds the import tables of the build that made it, so a long session pinned every build it ever had (17 import tables for 4 projects, 1.5 GB live after 23 reloads). A reload and a budget trim now clear it. The memory budget read the resident set alone, which the OS compresses or swaps for an idle sidecar (141 MB resident for 2.2 GB committed), so it never tripped. It now reads the larger of the resident set and the collector's committed heap.
MelbourneDeveloper
enabled auto-merge (squash)
November 20, 2026 11:10
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An installed F# sidecar held 2.4 GB after a 13-hour session on this repository (4 F# projects, 23 workspace reloads). A heap dump showed 1.56 GB live and 17 compiler import tables for 4 project builders.
Two defects, both in SharpLsp's F# sidecar (not lspkit: the retained graph is
FSharpSidecar → FSharpWorkspaceState → EntityCache → AssemblySymbol → FSharpEntity → SymbolEnv → TcImports):FSharpWorkspaceState.Entitiescaches each referenced assembly's FCS symbols by file name. Each symbol holds the import tables of the build that made it, and neither a workspace reload nor a budget trim cleared the cache, so it pinned every build the session ever had.WorkingSet64only. macOS had compressed/swapped the idle sidecar to 141 MB resident while the collector had 2.17 GB committed, so the 2 GB soft limit never tripped.Fix
Tests
a reload and a trim release the referenced entities of the build they replace— failed before the fix ("the reload emptied the entity cache"), passes after; it also proves with a weak reference that nothing else pins the replaced build's entities.make _lint-dotnet: 0 warnings.Refs #566 (stays open until verified on released binaries).