[release/8.0-staging] Add an in-memory cache for CRLs on Linux by bartonjs · Pull Request #127626 · dotnet/runtime (original) (raw)
and others added 2 commits
Introduce an extra layer of caching for CRLs.
- The cache has a fixed size of 30 elements. When full, it evicts the least-recently-used entry.
- Using the same finalizable object sentinel approach as ArrayPool, the cache will purge entries every time the GC finalizes.
- During a finalize, the current MRU node is marked as what to purge next time.
- Using that node moves the purge target to the next-older entry before the node is promoted back to MRU.
- On the subsequent finalize, the marked node (and everything after it) are purged.
- To avoid finalizing the CRL SafeHandles, the cache does an AddReference on every item that is returned (so the caller must Release it), and it calls Dispose on anything it evicts.
- GC/Finalization-triggered cooperative eviction is not performed until the probe object is promoted to the final GC generation (currently Gen2)
Co-authored-by: Jan Kotas jkotas@microsoft.com Co-authored-by: Copilot 175728472+Copilot@users.noreply.github.com
Copilot AI review requested due to automatic review settings
This was referenced
May 1, 2026
Copilot AI review requested due to automatic review settings
This was referenced
May 1, 2026
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
[ Show hidden characters]({{ revealButtonHref }})