You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MemoryCache may under-count its size on net10 when an entry is replaced during an expiration scan #422
On net10.0, MemoryCache from Microsoft.Extensions.Caching.Memory may under-count its running size when a sized entry is replaced while an expiration scan runs. An under-count lets a size-limited local tier hold more than SizeLimit before it compacts. Values are never wrong or lost; only the limit is weakened.
What was observed
A probe against the bare framework cache (no library code) replaced a size-3 entry while expiration scans ran:
Runtime
Size reported while holding one size-3 entry
net10.0
0 in 193,944 of 200,000 rounds
net8.0
3 every time
Scope
Exists on main today: any size-limited local tier on net10.0 whose keys are rewritten is exposed, with or without fail-safe.
Activity