locked
Carousel Pages and memory RRS feed

  • Question

  • User82515 posted

    Has anyone experienced memory issues with Carousel Pages? I have a carousel page that has up to 7 content pages within - there's a few list views and an image control which displays an image but after popping from the carousel page (which in my mind should release all resources), and then going back to said carousel page, the app crashes at the second time of trying to load an image - I can see from the stack it's memory related - I've tried the following code to try and force the release of resources but it doesn't work. Instead of using the built in navigation, I hid the title bar and nav and implemented my own back button so I could try and release all resources. But it just doesn't work!

     private async Task ExitAndDestroy()
            {
                GC.Collect();
    
                //we have to release MANY resources (naughty Xamarin!)
                DeleteOriginalCameraImage();
                DeleteOriginalMediaItems(true);
    
                foreach (var c in this.Children)
                {
                    c.Content = null;
                }
    
                GC.Collect();
    
                await Navigation.PopAsync(true);
            }
    

    Thanks

    Saturday, May 23, 2015 8:28 PM

Answers

  • User107505 posted

    on Android, Carousel Pages has a lot of problem with the memory. on iOS C.p. seems to work well

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, May 27, 2015 9:46 AM

All replies

  • User107505 posted

    on Android, Carousel Pages has a lot of problem with the memory. on iOS C.p. seems to work well

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, May 27, 2015 9:46 AM
  • User32870 posted

    Same problem with Windows Phone: out of memory exception. There is already a bug logged for this: https://bugzilla.xamarin.com/show_bug.cgi?id=30835

    Saturday, June 20, 2015 2:57 PM
  • User242918 posted

    did anybody find some solution to this problem

    Wednesday, May 3, 2017 12:10 PM
  • User272135 posted

    @georgethms10 Jason Smith, an engineer for Xamarin forms, recommends using a carousel view within a content page advises to not use a carousel page.

    Wednesday, May 3, 2017 12:22 PM
  • User242918 posted

    @NashZhou I have replaced my implementation to Carousal View. There is one thing that bugs me. I have three pages in carousal. I use a Device.startTimer to change page every 4 seconds. The problem is each time when the value in Item template changes the System.string in xamarin profiler shows 0.2 mb increase. If i stay in the page for more than 10 min it shows 10-20 mb string size. I cannot track this down.

    Thursday, May 4, 2017 9:59 AM
  • User377308 posted

    I have used CarouselView in my Xamarin Forms application that contains multiple images coming from the server to serve it as an image slider , but whenever i scroll to the next image and hold the carousel for a while the app crashes with an unhandled exception message. does anyone have a clue what's going wrong?

    Thursday, September 13, 2018 7:15 AM
  • User198446 posted

    https://github.com/AndreiMisiukevich/CardView

    Saturday, September 15, 2018 7:56 PM