0

When configuring the image pipeline, you can set the maximum size of each of the caches. But there are times when you might want to go lower than that. For instance, your application might have caches for other kinds of data that might need more space and crowd out Fresco’s. Or you might be checking to see if the device as a whole is running out of storage space.

Your application can then configure the pipeline with objects implementing the MemoryTrimmableRegistry interfaces.

These objects must keep a list of trimmables. They must use app-specific logic to determine when memory or disk space must be preserved. They then notify the trimmable objects to carry out their trims.

I have tried to implement that with no success by reference https://github.com/facebook/fresco/issues/1457, anyone can help?

Logan Guo
  • 865
  • 4
  • 17
  • 35
  • Try to clear the cache when user close the application. I always do this thing whenever I use the fresco lib when user exit from the application in onDestroy() clear all the Fresco pipeline caches. – Andy Developer Jul 11 '17 at 13:58
  • 1
    Another way you can achieve this where you extends Application inside that you can set lowMemory() and onTerminate() method inside that clear the all the fresco cache. – Andy Developer Jul 11 '17 at 14:00

0 Answers0