问题
i'm working on a flutter app, which displays a lot of images of unknown aspect-ratio in a list (among other things)
to improve the UX a row with an image displays the original image with a blurred version of it in the background (in a stack).
- To create the blurred version i use the
image
library (https://pub.dev/packages/image) - to not block the UI thread with decoding, blurring and encoding i use isolates
But after some testing i've been facing an issue with memory - the Isolate does not seem to get cleanup up properly (despite killing it after the image processing is done)
It goes as so far, as the apps crashes with "out of memory" (android and iOS)
Things i've tried:
compute
method in flutter (still leaking)isolate
package (https://pub.dev/packages/) (still leaking)Future.microtask
- not leaking, but blocking UI thread.
Has anbody else had a similar issue?
来源:https://stackoverflow.com/questions/57826962/flutter-isolate-image-manipulation-memory-issue