Flutter Isolate image manipulation Memory Issue

*爱你&永不变心* 提交于 2020-01-25 00:25:08

问题


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 imagelibrary (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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!