Manage memory in a map-based iOS application

I am developing a map-based enterprise application and it needs to display information gathered from a large workforce and display it on every working iPad. Thus, the number of markers on the map can grow very rapidly (several thousand) quickly. In addition, each token will be backed up by a subclass of NSManagedObject, which is stored in memory while the token exists.

I use the Google Maps iOS SDK, and the problem is that even without any markers, just panning and zooming causes very large increases in memory usage. The dirty memory size of the application is 100 MB (using the Industry tool) at startup. A small amount of panning and zooming allows you to quickly shoot up to 300, and the problem is that I stop panning and zooming, the memory never drops. Similarly, if I have a lot of markers and I delete them, again, there is no memory fall (when I delete markers, I will definitely not refer to any of the objects). The only time memory drops is when I change the types of cards. If I widely pan / zoom in on the streets, switch to satellite viewing, there will be a sudden drop of 50 MB + into dirty memory.

So, I was wondering if anyone has any tips on working with memory when using Google Maps or any information on how Google Maps manages / frees up memory?

+4
source share

Source: https://habr.com/ru/post/1501916/


All Articles