关于 flutter GridView ListView 加载多张大图oom,Message from debugger: Terminated due to memory issue

看起来像是flutter本身的内存管理释放问题,即使在页面释放image的cache也不行。

原因是因为旧版本的flutter对GridView和ListView组件加载高分辨率图片的缓存和回收处理有问题导致内存暴涨无法自动回收,手动关掉缓存,清图片cache也不行。官方在最新master分支代码解决了这个问题,加载图片的时候内存占用没有明显波动

参考:

https://github.com/flutter/flutter/issues/32143

https://github.com/flutter/flutter/issues/28912

https://github.com/flutter/flutter/issues/19754

https://github.com/flutter/flutter/issues/20521

https://github.com/flutter/flutter/pull/42785

https://github.com/flutter/flutter/issues/28037

https://github.com/flutter/engine/pull/9329

https://github.com/flutter/flutter/issues/32286

https://github.com/flutter/engine/pull/9486

https://github.com/flutter/flutter/issues/28037

https://github.com/flutter/flutter/issues/19558

https://github.com/flutter/flutter/issues/26837#issuecomment-456675863

https://github.com/flutter/flutter/issues/28912

https://github.com/flutter/flutter/issues/21571

https://github.com/flutter/engine/pull/9486

https://github.com/alibaba/flutter_boost/issues/245

http://www.ptbird.cn/flutter-route-named-route-list-root-route.html#menu_index_10

而且问了下不会merge到1.9.1hotfixes分支。只能等最新的稳定版了,或者自己改一个版本

 

原文地址:https://www.cnblogs.com/nightfallsad/p/11726206.html