Skip to content

IL: fix leaking binary view - #20250

Open
auduchinok wants to merge 2 commits into
dotnet:mainfrom
auduchinok:il-binaryViewLeak
Open

IL: fix leaking binary view#20250
auduchinok wants to merge 2 commits into
dotnet:mainfrom
auduchinok:il-binaryViewLeak

Conversation

@auduchinok

@auduchinok auduchinok commented Aug 12, 2026

Copy link
Copy Markdown
Member

Fixes binary view is kept instead of getting it in the lambda.

For non-framework assemblies a weak reference is used for metadata. However, seekReadInterfaceImpls captured the metadata view, so the metadata was kept in memory. For project with many non-framework references it retained a lot of memory.

Retained memory after ParseAndCheckProject:

Project Before (MB) After (MB) Diff (%)
Console app 33.89 33.83 −0.17%
FCS 1270.99 1270.45 −0.04%
Fantomas.Core 111.50 109.44 −1.85%
Fantomas.Core.Tests 144.48 141.93 −1.77%
Fantomas.Benchmarks 75.57 64.83 −14.21%
FSharp.Common 445.02 297.69 −33.10%

References distribution:

Project WeakByteFile (.nuget\packages) strong ByteFile
Console app 0 refs / 0.0 MB 167 refs / 5.8 MB
FCS 0 refs / 0.0 MB 178 refs / 8.5 MB
FSharp.Common 487 refs / 287.2 MB 2 refs / 0.3 MB
Fantomas.Core 120 refs / 6.7 MB 1 ref / 3.9 MB
Fantomas.Core.Tests 26 refs / 7.9 MB 169 refs / 10.8 MB
Fantomas.Benchmarks 25 refs / 20.0 MB 169 refs / 10.8 MB

@auduchinok
auduchinok requested a review from a team as a code owner August 12, 2026 15:30
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant