-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix #97736 in MemoryCache.cs with a lock around the TriggerOvercapacityC... method #103992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to this area: @dotnet/area-extensions-caching |
|
@dotnet-policy-service agree |
|
@ADNewsom09 would it be appropriate to make @myk0la999 the "author" on your first commit? It seems that you took the code he proposed at #97736 to start this. |
|
Sounds fine to me. We implemented this code internally to solve this problem and wanted to share it back.
|
src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs
Outdated
Show resolved
Hide resolved
requested by Jozkee Co-authored-by: David Cantú <dacantu@microsoft.com>
|
@ADNewsom09 FYI, I've force-pushed to your branch to list @myk0la999 as the author of 4fed137.
|
This solves #97736
This PR addresses the excessive CPU and memory usage during the MemoryCache compaction process by limiting the number of concurrent compaction tasks to one. The change ensures that only one thread performs the compaction at any given time, reducing resource spikes and improving overall performance.