Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Memory Leaks? #16

Closed
EmmanVazz opened this issue Dec 11, 2016 · 7 comments
Closed

Memory Leaks? #16

EmmanVazz opened this issue Dec 11, 2016 · 7 comments

Comments

@EmmanVazz
Copy link

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!

@Motaz-Al-Zoubi
Copy link

I am suffering from memory leaks issues with the carousel view control in Xamarin forms,
the emulator keeps throwing out of memory exception while looping through the slides.
is this a common issue with this control or there is something i should figure out,
any help please?

@EmmanVazz
Copy link
Author

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.

@Motaz-Al-Zoubi
Copy link

Any update on this issue?

@JRC-BitBull
Copy link

Yeah, I seem to be getting memory leaks with items placed in a CarouselView. Really interested whether anyone has any workarounds!

@shoeIT
Copy link

shoeIT commented Sep 11, 2017

the workaround is to use the controll which works fine and is still under developement:
https://github.com/alexrainman/CarouselView

@JRC-BitBull
Copy link

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.

@paul-kiar
Copy link

Since this project is closed but I need to use it, I have reworked this PR as a Patch that can be used by just copying this code into your Client project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants