Flutter Isolate image manipulation Memory Issue
Asked Answered
B

0

5

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?

Baines answered 6/9, 2019 at 18:27 Comment(1)
have you had solution for this problem yet? I have same issue as you. The image in compute seem like not clean up and the memory keep growing then crash appLammond

© 2022 - 2024 — McMap. All rights reserved.