iOS6 MKMapView using a ton of memory, to the point of crashing the app, anyone else notice this?

After a lot of playing around and testing different ideas, some of which were mentioned here, the final solution that worked for me was as follows.

  • Instead of creating new MKMapView’s as needed in the app, I added an mkMapView property to my AppDelegate and only created it when needed. Once it has been created, it lives in the AppDelegate forever and I reuse that single instance everywhere needed. This really helped in reducing the amount of memory being used as I was previously instantiating a couple different MKMapView’s and both were burning through memory pretty quickly.

  • I also found that iOS 6 Maps handles releasing memory very well once a Memory Warning has been received. Yes, it does use up more memory while zooming and panning, but seems to be responding to Memory Warnings appropriately.

  • The last thing I had to do was work on reducing my overall initial memory footprint. I noticed I was starting off way higher than I expected so that was also contributing to the crashes I was receiving related to memory. Once I got the initial footprint down, let MKMapView handle releasing it’s memory during Memory Warnings, and made sure I only had 1 instance of MKMapView that I could reuse throughout the app, everything is running fine.

Leave a Comment