facebook/fresco

Memory cache keeps growing when using non-static images in Recyclerview

Open

#2,502 opened on May 19, 2020

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Java (17,072 stars) (3,750 forks)batch import
enhancementgood first issuehelp wanted

Description

Description

I'm using lots of .webp images in my Recyclerview. And if I keep scrolling the Recyclerview, the native memory keeps growing until it reaches the maximum memory cache limit. I've also tested with the demo by jumping between fragments which has .webp images in it, still the native memory grows to the limit. It looks like Fresco will create a new cache for the same image every time the image got loaded.

I've already tried several ways, like reduce the memory cache limit or clear memory cache every time I leave the page. but these solutions can't solve the problem without affecting user's experience. Is there any way to fix or avoid this problem?

Reproduction

Any app that is using Fresco to load non-static images should be able to reproduce this problem.

Additional Information

Using .gif format has the same problem.

  • Fresco version: [2.2.0]
  • Platform version: [Android 9 / 10] (I've only tested with these two version)

Contributor guide

Memory cache keeps growing when using non-static images in Recyclerview · facebook/fresco#2502 | Good First Issue