Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cached image (ffimageloading) with OUT OF MEMORY error on android - xamarin forms

I have a listview with some images in a ffimageloading:CachedImage library.... but...when I am testing I am doing it repeatedly: I open the listview and press the back button on the actionbar, at a determined time, when I press the back button I have an exception:

03-02 09:31:13.511 I/art ( 2430): Starting a blocking GC Explicit 03-02 09:31:13.522 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.522 I/art ( 2430): Explicit concurrent mark sweep GC freed 10820(745KB) AllocSpace objects, 90(1956KB) LOS objects, 3% free, 92MB/96MB, paused 136us total 9.552ms 03-02 09:31:13.535 D/Mono ( 2430): GC_OLD_BRIDGE num-objects 997 num_hash_entries 50753 sccs size 25365 init 0.00ms df1 37.29ms sort 7.73ms dfs2 26.26ms setup-cb 1.58ms free-data 17.62ms links 67211/67211/24685/2 dfs passes 118961/92576 03-02 09:31:13.535 D/Mono ( 2430): GC_BRIDGE: Complete, was running for 79.60ms 03-02 09:31:13.535 D/Mono ( 2430): GC_MAJOR_SWEEP: major size: 9136K in use: 8634K 03-02 09:31:13.535 D/Mono ( 2430): GC_MAJOR: (LOS overflow) time 60.53ms, stw 67.10ms los size: 27648K in use: 8339K 03-02 09:31:13.578 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.578 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.580 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.585 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.585 I/art ( 2430): Alloc partial concurrent mark sweep GC freed 4847(397KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 92MB/96MB, paused 191us total 5.177ms 03-02 09:31:13.585 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.594 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.594 I/art ( 2430): Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 4% free, 92MB/96MB, paused 172us total 8.267ms 03-02 09:31:13.594 I/art ( 2430): Forcing collection of SoftReferences for 7MB allocation 03-02 09:31:13.594 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.602 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.602 I/art ( 2430): Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 4% free, 92MB/96MB, paused 178us total 7.794ms 03-02 09:31:13.602 W/art ( 2430): Throwing OutOfMemoryError "Failed to allocate a 8294412 byte allocation with 4161352 free bytes and 3MB until OOM" 03-02 09:31:13.602 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.602 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.604 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.609 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.609 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.613 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.614 I/art ( 2430): Forcing collection of SoftReferences for 7MB allocation 03-02 09:31:13.614 I/art ( 2430): Starting a blocking GC Alloc 03-02 09:31:13.621 I/art ( 2430): Clamp target GC heap from 108MB to 96MB 03-02 09:31:13.621 I/art ( 2430): Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 4% free, 92MB/96MB, paused 186us total 7.048ms 03-02 09:31:13.621 W/art ( 2430): Throwing OutOfMemoryError "Failed to allocate a 8294412 byte allocation with 4162792 free bytes and 3MB until OOM" 03-02 09:31:13.621 D/skia ( 2430): --- allocation failed for scaled bitmap Unhandled Exception: Java.Lang.OutOfMemoryError: Failed to allocate a 8294412 byte allocation with 4162792 free bytes and 3MB until OOM

before this error I also can see in output:

03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.MiniLoggerWrapper.Error (System.String errorMessage, System.Exception ex) [0x00000] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\MiniLoggerWrapper.cs:30 03-02 09:28:17.208 I/mono-stdout( 2430): --- End of stack trace from previous location where exception was thrown --- 03-02 09:28:17.208 I/mono-stdout( 2430): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0 03-02 09:28:17.208 I/mono-stdout( 2430): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <657aa8fea4454dc898a9e5f379c58734>:0 03-02 09:28:17.208 I/mono-stdout( 2430): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0 03-02 09:28:17.208 I/mono-stdout( 2430): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0 03-02 09:28:17.208 I/mono-stdout( 2430): at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0 03-02 09:28:17.208 I/mono-stdout( 2430): at FFImageLoading.Work.WorkScheduler+d__43.MoveNext () [0x001bb] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\WorkScheduler.cs:158 03-02 09:28:17.208 I/mono-stdout( 2430): --- End of managed Java.Lang.OutOfMemoryError stack trace --- 03-02 09:28:17.208 I/mono-stdout( 2430): java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available 03-02 09:28:17.211 I/Choreographer( 2430): Skipped 80 frames! The application may be doing too much work on its main thread.

I updated the ffimageloading but the error still here...I tried the

MONO_GC_PARAMS=bridge-implementation=old

in a enviroment txt

This is my xaml in PCL:

<?xml version="1.0" encoding="utf-8" ?>
 <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="neoFly_Montana.Views.ProdutosView"          
         xmlns:local="clr-namespace:neoFly_Montana.LayoutScripts"
         xmlns:interface="clr-namespace:neoFly_Montana.Interface"
         xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
         BackgroundImage="prodBackground.jpg"
         x:Name="ParentHost">

<ContentPage.Content>

        <Grid HorizontalOptions="FillAndExpand" RowSpacing="0" VerticalOptions="FillAndExpand">
        <Grid.RowDefinitions>
            <RowDefinition Height="9.4*"/>
            <RowDefinition Height="0.6*"/>
        </Grid.RowDefinitions>

        <!-- Lista de produtos -->
            <ListView Grid.Row="0" Grid.Column="0" ItemSelected="ListView_ItemSelected" CachingStrategy="RecycleElement" BackgroundColor="Transparent" x:Name="listview_produtos" Margin="10,0,10,0" SeparatorVisibility="None" HasUnevenRows="True" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">

            <ListView.Header>

                <!-- Observação -->
                <StackLayout>
                <StackLayout x:Name="prod_stack_obser" IsVisible="False" Orientation="Horizontal" Spacing="0" HorizontalOptions="FillAndExpand">
                    <Label x:Name="label_observ" HorizontalTextAlignment="Start" VerticalOptions="Center" FontSize="Small" TextColor="White" Style="{StaticResource labelsfont}" Margin="20,10,0,10" />
                    <ffimageloading:CachedImage x:Name="lapis" Source="lapis.png" IsVisible="False" HorizontalOptions="EndAndExpand"/>
                </StackLayout>
                <BoxView HeightRequest="20"/>
                </StackLayout>
            </ListView.Header>

                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>

                        <Grid Margin="20,0,20,20">
                            <ffimageloading:CachedImage Source="texturaCateg.png" BackgroundColor="{Binding FundoColor, Source={x:Reference ParentHost}}" Grid.Row="0" Grid.Column="0" Aspect="Fill" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>

                            <StackLayout Grid.Row="0" Grid.Column="0" VerticalOptions="FillAndExpand" x:Name="produtos_stack_color" Spacing="10">

                                <StackLayout Spacing="0" Grid.Row="0" Grid.Column="0" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand">

                                <StackLayout Orientation="Horizontal" Padding="10,10,10,0" VerticalOptions="Center" HorizontalOptions="FillAndExpand">
                                        <ffimageloading:CachedImage FadeAnimationForCachedImages="True" DownsampleUseDipUnits="True" DownsampleHeight="60" HeightRequest="83" WidthRequest="130" Source="{Binding imagem}" Aspect="Fill" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" >
                                            <!--<ffimageloading:CachedImage.CacheKeyFactory>
                                                <interface:CustomCacheKeyFactory/>
                                            </ffimageloading:CachedImage.CacheKeyFactory>-->
                                        </ffimageloading:CachedImage>

                                        <!--HeightRequest="83" WidthRequest="100"-->
                                        <!--DownsampleHeight="83"-->
                                        <!--<StackLayout Orientation="Horizontal" VerticalOptions="Center" HorizontalOptions="EndAndExpand">
                                                <Label Style="{StaticResource labelsfont}" Text="R$" VerticalOptions="CenterAndExpand" TextColor="{Binding TextColor, Source={x:Reference ParentHost}}" FontSize="Medium"/>
                                                <Label Style="{StaticResource labelsfont}" Text="{Binding valor}" TextColor="{Binding TextColor, Source={x:Reference ParentHost}}" FontAttributes="Bold" VerticalOptions="Start" FontSize="30"/>
                                            </StackLayout>-->

                                </StackLayout>

                                        <!--nome-->
                                    <Label Text="{Binding nome}"  Margin="0,10,0,10" Style="{StaticResource labelsfont}" TextColor="{Binding TextColor, Source={x:Reference ParentHost}}" HorizontalTextAlignment="Center" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="CenterAndExpand"/>

                                </StackLayout>
                                <Grid VerticalOptions="FillAndExpand">
                                    <BoxView Grid.Row="0" Grid.Column="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="WhiteSmoke" Opacity="0.2"/>
                                    <Label Grid.Row="0" Grid.Column="0" Margin="10,10,10,10" HorizontalTextAlignment="Center" Text="{Binding observacao}" Opacity="1" FontSize="Small" Style="{StaticResource labelsfont}" TextColor="{Binding TextColor, Source={x:Reference ParentHost}}" HorizontalOptions="Center" />
                                </Grid>
                            </StackLayout>
                        </Grid>

                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
                <ListView.Footer>

                <StackLayout>
                    <Grid x:Name="prod_rl_fundo" >
                    <Grid.Margin>
                        <OnPlatform x:TypeArguments="Thickness"
                                 iOS="20,0,20,0"
                                 Android="20,10,20,10"/>
                    </Grid.Margin>
                        <ffimageloading:CachedImage x:Name="prod_acomp_img" Source="texturaCateg.png" Grid.Row="0" Grid.Column="0" HorizontalOptions="FillAndExpand" Aspect="Fill" VerticalOptions="FillAndExpand"></ffimageloading:CachedImage>

                        <!--Acompanhamentos-->
                    <StackLayout x:Name="stack_acompanhamentos" Spacing="0" Grid.Row="0" Grid.Column="0">

                        <Grid x:Name="prod_acompanhamentos_title" HorizontalOptions="FillAndExpand">
                            <BoxView Grid.Row="0" Grid.Column="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" BackgroundColor="WhiteSmoke" Opacity="0.2"/>
                            <Label x:Name="produtos_acomp_title" Text="+ Dois Acompanhamentos" Grid.Row="0" Grid.Column="0" Style="{StaticResource labelsfont}" Margin="20,20,20,20" FontAttributes="Bold" VerticalOptions="CenterAndExpand" HorizontalOptions="Center" />
                        </Grid>

                    </StackLayout>
                    </Grid>

                <BoxView HeightRequest="50"></BoxView>
                </StackLayout>

            </ListView.Footer>

            </ListView>

            <!--Rodapé Grid-->
            <Grid Grid.Row="1" Grid.Column="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
            <ffimageloading:CachedImage Source="rodape.png" 
                       HorizontalOptions="FillAndExpand"
                       Aspect="AspectFill"
                       VerticalOptions="FillAndExpand"
                   Grid.Row="0"/>

            <!--Escrito Rodapé-->
            <StackLayout Orientation="Horizontal" 
                   Margin ="5,5,5,5" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" Grid.Row="0">
                    <Label
                   FontSize="Micro"
                   Text="Você está em:"
                   Style="{StaticResource labelsfont}"
                   VerticalOptions="CenterAndExpand"
                   TextColor="White"/>

                    <Label FontSize="Micro"
                   Text="loja"
                   x:Name="prod_lbl_lojaprox"
                   Style="{StaticResource labelsfont}"
                   VerticalOptions="CenterAndExpand"
                   TextColor="{StaticResource laranjacolor}"
                   LineBreakMode="TailTruncation"
                   FontAttributes="Bold" />
                </StackLayout>
            </Grid>
        </Grid>

</ContentPage.Content>

My mainActivity:

  protected override void OnCreate(Bundle bundle)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(bundle);

        global::Xamarin.Forms.Forms.Init(this, bundle);

        //inicializa imageCircle
        ImageCircleRenderer.Init();

        //shared Preferences
        App.Init(new AndroidUserPreferences());

        //Gerenciador de memória
        CachedImageRenderer.Init(true);
        var config = new FFImageLoading.Config.Configuration()
        {
            VerboseLogging = false,
            VerbosePerformanceLogging = false,
            VerboseMemoryCacheLogging = false,
            VerboseLoadingCancelledLogging = false,
            FadeAnimationForCachedImages = false,
            MaxMemoryCacheSize = 50000000,
            FadeAnimationDuration = 500

            //Logger = new CustomLogger(),
        };
        FFImageLoading.ImageService.Instance.Initialize(config);

        LoadApplication(new App());
    }

     public override void OnTrimMemory([GeneratedEnum] TrimMemory level)
    {
        FFImageLoading.ImageService.Instance.InvalidateMemoryCache();
        GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);

        base.OnTrimMemory(level);
    }

    public override void OnLowMemory()
    {
        FFImageLoading.ImageService.Instance.InvalidateMemoryCache();
        GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);

        base.OnLowMemory();
    }

My images are base64 (png) they have 8kb and they are 150x84 px

one of them :

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABQCAMAAADMbnx5AAAC/VBMVEUAAAAAAAAAAAAAAAABAQEAAAAEBAQAAAAAAAAA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5xrzkIPQKzRDcahbN2mKIYGFJAFimFvpCmkTECwfCAMNgBFmGFTjjKputH52fJ4lAZmmWVa+rOoKl5lUdZaxM+2yooUFiFQr4IBUELtuwHqdn0ms3SVQMXK1m6yQXojl8/Ij7hbwhyyGBDtVkFrsOModpKLIsh/xcaZpSVhSlgG8ZcS9vbyu6gQf5tKqeVMIU5cPfKkPDDqSqw6qHDLPBxmJTIJuiYtFKtVmttk52cul8XsV7ZzZgT4DYJbLo+7HKMwzWCAPSlUKhfMNVIHPQwvqSNVRUz2wmwmHvDFqskUGHXb8HrOqckk96BwDmGJ/AMgy2cCJaqaysrFSr1Wbr8vJypxYMMph7iDxL00KQZRn+In8jsqJoWkGDWYUj/MCto/2ieRwLhykf7B8d8xCojvo9xjBU8gZscHLU5/VBVKyNRlRF2nLpdM5Wmih30mraxMWjet2yLMWCX9ghkskfuAQ4iMInHBemqZFhh8NlQ3XfUT2ajICRUrpdTsfw5KiXkHnDILtDuyWEVirRRAxKEPJoWyVM4VJ0PhGboyjvNJC8cyPPYZTL3df1X1B3YP9qs4MVBaEwDMObpBnBxoVycHFAdOMclw3YTbT1ZroHr3ne7+fISdxlfQRRET68WhvzrLh8IauCm0W7TtA4eNqycHL4wd9udkdm0mZ2j8Nk37t3g0yE4kJPqJdgXPz5d1b8SFY3wT0mqwYujmOyvzRoPMTT9BGNH93QVyeZFCrH9DLKYDEZMs4mtFM1/rplVjjxNpvWmVP1rirb+dDUkNQJUwxlqGOwKCuhUQ1b3fSt7xartaLEQEocfPThKnRDGBGpkjKVMm1DHZc90bCBQ1c1Yx/awXvnXKfx7P3Qhn5sKjyATHRZSTIl1HFZomHLCnDSwcO3HxrzADKRSJYpmd5PMxu4soSHD+BmvCMOHoHyc6z0flP6lzVbxJ3h4UO4HRg45gGE6EOkfTXhpGMAGcY4XkgjTwQh+qRp3y0B0yLmmOcfWN+InURusO8AAAAASUVORK5CYII=

update: I have Searched so much...Do I need a cache key??

like image 469
Joyce de Lanna Avatar asked Feb 26 '18 14:02

Joyce de Lanna


People also ask

What is ffimageloading in Xamarin forms?

Almost every application uses images for one reason or another, and using FFImageLoading makes it easier for you to cache, download, and use these images in an optimized manner. Let’s work through an example. In your Xamarin.Forms application, right click on your solution to add the following package.

Which Xamarin apps support multiple image views?

Xamarin.iOS, Xamarin.Android, Xamarin.Forms, Xamarin.Mac, Xamarin.Tizen and Windows (WinRT, UWP) support Multiple image views using the same image source (URL, path, resource) will use only one bitmap, which is cached in memory (less memory usage) Deduplication of similar download/load requests.

How to add ffimageloading views in XAML file?

Start adding the FFImageLoading Views on your XAML file by using CachedImage keywords. Here are 5 sample properties of FFImageLoading. And here is the demo of this FFImageLoading sample app that we just created in a few minutes.

How do I enable ffimageloading in NuGet?

The first step is to right-click on your Solution. Then go to Manage NuGet Packages for Solution. On the browse tab, type FFImageLoading. Look for FFImageLoading Forms, SVG Forms, and Transformations. Then install on each project in your solution. Call CachedImageRenderer.Init () on each platform.


1 Answers

Have you implemented InvalidateMemoryCache into MainActivity? Read more at https://github.com/luberda-molinet/FFImageLoading/wiki/Advanced-Usage#clear-cache-and-memory-considerations

    public override void OnTrimMemory([GeneratedEnum] TrimMemory level)
    {
        FFImageLoading.ImageService.Instance.InvalidateMemoryCache();
        GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);

        base.OnTrimMemory(level);
    }

    public override void OnLowMemory()
    {
        FFImageLoading.ImageService.Instance.InvalidateMemoryCache();
        GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);

        base.OnLowMemory();
    }

I think, the problem is with your base64 logic, but lets try this.

like image 133
Artūras Paleičikas Avatar answered Oct 06 '22 12:10

Artūras Paleičikas