-
Notifications
You must be signed in to change notification settings - Fork 38
Memory Leaks? #16
Comments
I am suffering from memory leaks issues with the carousel view control in Xamarin forms, |
I ran across this https://forums.xamarin.com/discussion/comment/243673?utm_campaign=Weekly%2BXamarin&utm_medium=email&utm_source=Weekly_Xamarin_116 . It seems like they will fix it in 2.4.0, which should be released in February. So I guess we will have to wait till then. |
Any update on this issue? |
Yeah, I seem to be getting memory leaks with items placed in a CarouselView. Really interested whether anyone has any workarounds! |
the workaround is to use the controll which works fine and is still under developement: |
I am using the latest version of that control and it leaks memory with Image objects on Android. I managed to create a pretty hacky workaround that doesn't leak... The DataTemplate in CarouselView is my own custom class that is a Subclass of Grid, call it MyDataTemplate. When one of these is added to a parent view ( OnSizeAllocated ) I perform a recursive callback to figure out the parent page and register the DataTemplate with the parent page. When I am sure I don’t need the page any more I loop through all the registered MyDataTemplate instances and call a FreeMemory() method on them, this removes all the children from the Grid (including the Image instances) and seems to prevent any memory leaks. |
Is anyone experiencing leaks of the children when using Carousel Views? I think it is related to this bug however I wanted to see if other people had workarounds.
Thanks!
The text was updated successfully, but these errors were encountered: