看板 Soft_Job 關於我們 聯絡資訊
最近嘗試碰Flutter來寫App,寫完後給QA測試發現用久了會很Lag。 然後用AS內建的Profiler查看是什麼原因導致Lag,結果應該是該功能裡的圖片載入後 記憶體會飆升,且在離開後記憶體不會馬上釋放。大概要過個3、4分鐘後才慢慢降下 來。在古狗半天解讓記憶體降下來的方法後都沒找到好的解法 想說請問這邊的前輩有沒有什麼辦法可以解 環境: https://imgur.com/a/LXCNN6j 使用情況: 再載入圖片前正常使用APP,記憶體使用量約 200M,在載入兩張圖片後標到450M左右。 (一張圖約1MB左右,JPG,以壓縮過。),在載入其他的照片會持續+記憶體的使用量,最 高到1G左右。 Profiler: https://imgur.com/a/YB6DDBu -- "One man looks at a dying bird and thinks there's nothin' but unanswered pain. But death got the final word. It's laughing at him." "Another man sees the same bird, feels the glory. Feeling something smiling through him." -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.163.212.124 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Soft_Job/M.1612349346.A.0F0.html
ripple0129: 建議你貼放圖片的程式碼這個能看的出原因的通靈真的要 02/03 21:48
ripple0129: 夠強 02/03 21:48
accessdenied: 1 MB jpg 壓縮什麼的,只對儲存空間有意義..載入耗 02/03 22:16
accessdenied: 用的記憶體是根據展開成 width x height x bits 的 02/03 22:16
accessdenied: 大小計算,懂? 02/03 22:16
htury: 用久了Lag,你確定是載圖嗎?猜是memory leak,查看看哪些 02/04 08:37
htury: 被keep住 02/04 08:37