-
Notifications
You must be signed in to change notification settings - Fork 8
Background caching memory growth #599
Comments
After debugging I think that the issue only happens when I try to cache RMBingSource. Also, this tile source needs to make a request to find the actual tile URL. |
I can confirm that I have the same problem using tiles served from Mapbox's servers. Downloading 7K tiles consumes over 200 MB of memory. The bigger problem is that the memory doesn't get released after the download completes. I'd love to enable my app users to download about 15K tiles since it would improve the user experience but I current limit it to avoid app crashes. Downloading 15K tiles worked just fine prior to iOS8 but has been broken since then. I spent about 80 hours working with Justin from Mapbox on the problem but we never found a solution. I'm hoping they will get to the bottom of it some day. |
Found the problem. NSURLConnection is leaking. Try using NSURLSession. I'm
|
That’s great news! Let me know if I can help test or at least buy you a 6 pack. -Ben
|
Hey @elemprod, I need some help! I have created this branch with the "fix" https://github.com/Moove-it/mapbox-ios-sdk/tree/nsurlconnection-leak.
|
@elemprod had any change to try it out ? |
Sorry, I've been slammed with a different project. I'll have time to try out a couple of things tomorrow. BTW I just verified that this problem does not exist on iOS7, it was introduced with iOS8. Maybe there is a clue there. |
I had some issues to test the current project in iOS 7 so I really don't know. My starting point for finding the issue was something I read that talked about NSURLConnection leaking on iOS 8. Let me know what you think! Thanks! |
Has there been any movement on this issue? We'd love to enable our users to download bigger maps and consequently buy more tiles from Mapbox but the leaking background download code prevents us from doing so. Thanks! |
This is a huge problem: we are forced now to manually release all cached images when it reaches a certain limit, because the automatic cache deallocation does not work. In our app users spend a lot of time browsing the map all over the world, which, due to the lack of caching is a terrible experience. Every view tiles, excesively. Before completely going into GL, could we please try and fix this? Thanks! |
Hello,
I'm running some issues with the background caching API.
I'm trying to cache multiple tileSources. After each tileSource finishes caching I start the new one. A lot of memory is allocated during the caching of one tileSource but most of the memory never gets deallocated.
After caching 3 tileSource (5000 tiles each ) I run out of memory.
Any suggestion on where the issue could be ? I can dig up anywhere but need some help.
The text was updated successfully, but these errors were encountered: