Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Carousel out of memory error

$
0
0

Does anyone know why this code...

        Image tut1 = new Image { Source = "tut01.jpg" };
        Image tut2 = new Image { Source = "tut02.jpg" };
        Image tut3 = new Image { Source = "tut03.jpg" };
        Image logo = new Image { Source = "logo.png" };

        ContentPage page1 = new ContentPage { Content = new StackLayout{ Children = { tut1 }, IsClippedToBounds = true } };
        ContentPage page2 = new ContentPage { Content = new StackLayout{ Children = { tut2 } } };
        ContentPage page3 = new ContentPage { Content = new StackLayout{ Children = { tut3 } } };
        ContentPage page4 = new ContentPage {BackgroundImage = "background.png", 
            Content = new ScrollView { 
                Content = new StackLayout { 
                    Children = { logo, buttonstack }
                }
            }
        };

        this.Children.Add(page1);
        this.Children.Add(page2);
        this.Children.Add(page3);
        this.Children.Add(page4);

...would cause memory errors on Android? It works fine on iOS and works on Android when I comment out 2 of the image pages. It just doesn't like loading 4 image pages in the carousel. They're only 30k or so each...

[OpenGLRenderer] Enabling debug mode 0
[AbsListView] unregisterIRListener() is called
[AbsListView] onVisibilityChanged() is called, visibility : 4
[AbsListView] unregisterIRListener() is called
[dalvikvm-heap] Grow heap (frag case) to 40.212MB for 2908176-byte allocation
[dalvikvm-heap] Grow heap (frag case) to 51.315MB for 11632656-byte allocation
[dalvikvm-heap] Forcing collection of SoftReferences for 11632656-byte allocation
[dalvikvm-heap] Out of memory on a 11632656-byte allocation.
[skia] --- allocation failed for scaled bitmap
[dalvikvm-heap] Grow heap (frag case) to 51.334MB for 2908176-byte allocation
[dalvikvm-heap] Grow heap (frag case) to 62.428MB for 11632656-byte allocation
[dalvikvm-heap] Clamp target GC heap from 68.428MB to 64.000MB
[dalvikvm-heap] Clamp target GC heap from 70.435MB to 64.000MB
[dalvikvm-heap] Forcing collection of SoftReferences for 891008-byte allocation
[dalvikvm-heap] Forcing collection of SoftReferences for 3563984-byte allocation
[dalvikvm-heap] Clamp target GC heap from 64.518MB to 64.000MB
[dalvikvm-heap] Out of memory on a 3563984-byte allocation.
[skia] --- allocation failed for scaled bitmap
[Choreographer] Skipped 59 frames! The application may be doing too much work on its main thread.

...

[dalvikvm-heap] Clamp target GC heap from 68.569MB to 64.000MB
[dalvikvm-heap] Forcing collection of SoftReferences for 266812-byte allocation
[dalvikvm-heap] Clamp target GC heap from 70.569MB to 64.000MB
[dalvikvm-heap] Out of memory on a 266812-byte allocation.
[AndroidRuntime] FATAL EXCEPTION: vts_com.ninthapp.locateya
[AndroidRuntime] java.lang.OutOfMemoryError
[AndroidRuntime] at oit.a(Unknown Source)
[AndroidRuntime] at ode.a(Unknown Source)
[AndroidRuntime] at oia.a(Unknown Source)
[AndroidRuntime] at ofb.a(Unknown Source)
[AndroidRuntime] at ofe.handleMessage(Unknown Source)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:99)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:137)
[AndroidRuntime] at ofb.g(Unknown Source)
[AndroidRuntime] at ohz.g(Unknown Source)
[AndroidRuntime] at oiq.run(Unknown Source)


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>