facebook/fresco

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

Open

#2,502 创建于 2020年5月19日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)Java (17,072 star) (3,750 fork)batch import
enhancementgood first issuehelp wanted

描述

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)

贡献者指南