You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got an issue with OOM on a very low device with random crashes. After investigation, I figure out that the problem with ImageHandler was reassigned.
Why did it happen?
Because in _OctoImageState in didUpdateWidget method each time reassign previous handler and saves current as well because of placeholder + progressBuilder properties. So in time, you have a situation where during the build method code executes build for all prev handlers and request all the images in the hierarchy(for 12 images on screen after 1 min with 10-sec delay of changing URL have 60 sec/10 delay =6 requests for each image + decoding job which cause the crash).
Fix proposal
Instead of each time reassigning handler need to create a new handler for the previous state without a placeholder and progress from the current handle or provide a way how to clear prev handler
instead of _previousHandler = _imageHandler;
Need to recreate ImageHandler without placeholder from current ImageHandler
Facing a similar issue, app just crashes when loading a few large images in grid view
could not find any crash logs on xcode, firebase crashalytics, and user local device app crash logs in user diagnostics
device: iphone 13 pro ios16.1.1
I got an issue with OOM on a very low device with random crashes. After investigation, I figure out that the problem with ImageHandler was reassigned.
Why did it happen?
Because in
_OctoImageState
indidUpdateWidget
method each time reassign previous handler and saves current as well because ofplaceholder + progressBuilder
properties. So in time, you have a situation where during the build method code executes build for all prev handlers and request all the images in the hierarchy(for 12 images on screen after 1 min with 10-sec delay of changing URL have 60 sec/10 delay =6 requests for each image + decoding job which cause the crash).Fix proposal
Instead of each time reassigning handler need to create a new handler for the previous state without a placeholder and progress from the current handle or provide a way how to clear prev handler
instead of
_previousHandler = _imageHandler;
Need to recreate ImageHandler without placeholder from current ImageHandler
This issue is not related to Flutter 3.x. It's reproducible on 2.10.3 and 3.x.
I also saw a couple of old issues with CachableImage on flutter GitHub, and I think that can be a root cause of crashes
The text was updated successfully, but these errors were encountered: