2

I was previously using Glide but it gave me too many OOMs. Then I started using Fresco from facebook. Still I am getting OOMs. I am using Fresco in recylerviews. I have tried the following

holder.image.setImageURI(item.getImageUrl());

and

ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(Uri.parse(item.getImageUrl()));

    DraweeController draweeController = Fresco.newDraweeControllerBuilder()
            .setOldController(holder.image.getController())
            .setAutoPlayAnimations(true)
            .build();
    hold.image.setController(draweeController);

Can anyone tell me why the bitmaps aren't getting recycled (I assumed that to be the problem)?

After checking Memory usage, I found that the Java code part keeps on increasing

Sourav Nag
  • 67
  • 7

1 Answers1

0

Maybe you should resize your images in the backend before you request and paint into recyclerview, but also you can make recyclerview caches a couple of views with this line (as example): mRecycler.setItemViewCacheSize(20)

FJCG
  • 1,017
  • 7
  • 6