flutter_pytorch_mobile icon indicating copy to clipboard operation
flutter_pytorch_mobile copied to clipboard

iOS: leaks

Open manmaor opened this issue 2 years ago • 1 comments
trafficstars

Hi, we experienced some leaks in our iOS app, after some investigation we found two memory leaks:

  • rawBytes in UIImageExtension (calloc not freed)
  • normalizedBuffer in UIImageExtension (malloc not freed)

from the Profiler: Profiler image

In the first case, I was able to free the memory at the end of the method. But in the second case, we return normalizedBuffer to use as the input, so I freed the input in PyTorchMobilePlugin.

Hoping for your fast response. Maor.

manmaor avatar Feb 20 '23 06:02 manmaor

@fynnmaarten Hello Fyn,

Can you please review this?

igala avatar Mar 13 '23 06:03 igala