關於 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分支。只能等最新的穩定版了,或者自己改一個版本

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM