Skip to content

Eviction processor no longer keeps cache instance alive - #20758

Open
majocha wants to merge 12 commits into
dotnet:mainfrom
majocha:fix-cache-disposal
Open

majocha wants to merge 12 commits into
dotnet:mainfrom
majocha:fix-cache-disposal

Conversation

@majocha

@majocha majocha commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

Make the background eviction agent shared and do not capture references to cache instances indefinitely. Cache instances no longer manage its lifetime, they simply post work items.
Get rid of cache disposal and finalizer. Idle caches should be quickly garbage collected now.

Fixes #20756

Checklist

  • Test cases added
  • Performance benchmarks added in case of performance changes
  • Release notes entry updated

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

❗ Release notes required

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

@majocha,

Caution

No release notes found for the changed paths (see table below).

Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format.

The following format is recommended for this repository:

`* . (PR #XXXXX)`

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.200.md No release notes found or release notes format is not correct
`vsintegration/src` docs/release-notes/.VisualStudio/18.vNext.md No release notes found or release notes format is not correct

@majocha
majocha marked this pull request as ready for review October 11, 2026 08:52
@majocha
majocha requested a review from a team as a code owner October 11, 2026 08:52

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 🕵️ AI review — verify independently.

Comment thread src/Compiler/Utilities/Caches.fs
Comment thread src/Compiler/Utilities/Caches.fs Outdated
@T-Gro T-Gro added the AI-reviewed PR reviewed by AI review council label Oct 12, 2026
@T-Gro
T-Gro self-requested a review October 12, 2026 08:37

This branch has not been deployed

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

Labels

AI-reviewed PR reviewed by AI review council

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Caches.Cache: its finalizer keeps a dropped check alive for one more full GC, and MailboxProcessor-mode caches are never collected

2 participants