New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Tiles generated from AssetTileProvider
is not removed from memory when Map disposed.
#1424
Comments
I've been able to reproduce the behavior with the provided code sample, but it might need further investigation to identify if it's an issue with the implementation of |
That's a good catch @TesteurManiak. There is an open issue (#62107) on the Flutter repo about image providers not releasing memory. I resolved the problem by adding these lines in the imageCache.clear();
imageCache.clearLiveImages(); It is not the best solution since it clears image cache for all image providers used in the app but I was ok with it. I did notice that in debug mode the allocated memory didn't go up but the RSS did. I haven't done a profile test (since that involves registering the app on App Store Connect and all the certificate registration steps) to see if the RSS allocation is only for debugging. I am not sure if this issue is to be kept open since there is a possibility the issue could be on the Flutter side. On a side note, is there an alternate recommendation for loading offline map? The MBTiles provider code that was initially part of the |
Hey @znromonk, I think I can help with sideloading. |
Thanks @JaffaKetchup. I will look into it. I think I will close the issue since the image cache issue is on the Flutter side and not this plugin. |
What is the bug?
When a map that uses
AssetTileProvider
is updated with new location, the memory is not released. If the location is updated, the allocated memory in the DevTools memory page keeps increasing.I have tested it on iPad simulator with two columns, one with a list of locations, and another with the map. The three tabs have three distinct locations.
What is the expected behaviour?
Memory released when map/tile is disposed.
How can we reproduce this issue?
ASSETS:
map.zip
Do you have a potential solution?
No response
Can you provide any other information?
fluttermap_memory_leak.mov
Platforms Affected
iOS
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console
Frequency
Consistently: Always occurs at the same time and location
Requirements
flutter doctor
finds no relevant issuesThe text was updated successfully, but these errors were encountered: