我有一个包含560个项目的列表,其中包含 FFImageLoading
本地加载和缓存的图像 . 当我尝试将列表滚动到底部和顶部几分钟 . 我没有任何日志等崩溃我认为内存低异常 .
我为 ReceiveMemoryWarning
函数实现了覆盖 .
public override void ReceiveMemoryWarning(UIApplication application)
{
ImageService.Instance.InvalidateMemoryCache();
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
base.ReceiveMemoryWarning(application);
}
并为 ImageService
设置属性 ClearMemoryCacheOnOutOfMemory
是 true
. 但它没有帮助 . 快速列表几分钟后从上到下滚动到顶部,我的应用程序崩溃了 .
如何避免内存异常和崩溃?