简体   繁体   中英

SKMaps, way to clear in-memory cache for map data when receiving memory warning from iOS?

I have an iOS app using the Skobbler Map Framework (SKMaps). I found that it uses a lot of memory. Granted, the UIViewController where I added the mapView is heavy without the mapView already, but it was working fine with SKMaps framework version 2.5.1. I was using light maps.

Now, since 3.0 light maps are no longer available and I have to use the full maps. Now quite some users are reporting crashes while navigating (sometimes after 10 minutes, sometimes after 3 hours, etc). After (a lot of) analysis turns out these are memory related (my app shows up as the largestProcess in the JetsamEvent logs with reason "vnode-limit").

I've already stripped about everything I can from my own app elements and data structures, but the SKMaps framework is still like 85% of my app's total memory usage. I've also implemented didReceiveMemoryWarning and added what I can for my own elements. I also did a lot of memory analysis with instruments and the Xcode 8 memory graph. No leaks found.

My guess is that it's related to the full map vs the light map in 2.5.1.

Is there a way to clear (or reduce) the in-memory cache of SKMaps upon receiving a memory warning?

The size of the map tiles cached on the device could cause the problem. In this case, SKTilesCacheManager class might help you. It provides advanced management for the tiles caching mechanism.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM