flutter_pytorch_mobile
flutter_pytorch_mobile copied to clipboard
iOS: leaks
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:

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.
@fynnmaarten Hello Fyn,
Can you please review this?