Android: Image cache strategy and memory cache size

后端 未结 3 2114
清歌不尽
清歌不尽 2021-02-05 22:01

I\'m implementing an image cache system for caching downloaded image.

My strategy is based upon two-level cache: Memory-level and disk-level.

My class is very si

3条回答
  •  盖世英雄少女心
    2021-02-05 22:03

    Don't do it! SoftReference is already enough! Actually SoftReference is designed to do exactly what you need. Sometimes SoftReference doesn't do what you need. Then you just get rid of SoftReference and write your own memory management logic. But as far as you use SoftReference you should not be worried about memory consumption, SoftReference does it for you.

提交回复
热议问题