ImageCache to clean dictionary instead of keeping semaphores permanently in memory #22251
Unanswered
MarkCiliaVincenti
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/LockingSemaphore.cs looks to be unreferenced and can be deleted.
ImageCache has a different implementation at https://github.com/dotnet/maui/blob/main/src/Compatibility/Core/src/Android/ImageCache.cs however the implementation as is keeps filling up a ConcurrentDictionary with semaphores per image name which are then never cleaned from memory.
Public API Changes
I am the author of a popular library called AsyncKeyedLock at https://github.com/MarkCiliaVincenti/AsyncKeyedLock and can propose changes to ImageCache to make use of this library which can clean up behind it with negligible performance difference.
Intended Use-Case
ImageCache.
Beta Was this translation helpful? Give feedback.
All reactions