Can the memory used by MKMapView be released some how?

家住魔仙堡 提交于 2019-12-30 18:32:12

问题


I am using an MKMapView in my iPhone application. When I load this view, the activity monitor instrument shows that the real memory of my App is increasing significantly. It keeps going up as you move the map around or zoom in and out. Once the View controller that loads this view is removed, the memory that was allocated due to the usage of the mapView does not get freed up. Is there something that can be done to get all this memory back?


回答1:


Is this on the simulator, or the actual device? Some parts of the simulator behave slightly differently to the actual device, and the simulator may not be clearing out the cache properly (since it doesn't have to given the amount of RAM on a Mac compared to an iOS device).

Have you checked to see if you have a memory leak using Instruments? (again, you should do this on the actual device, since occasionally the simulator behaves slightly differently, and will show false positives/negatives when it comes to memory leaks)




回答2:


For what its worth, there are similar related questions here:

  • https://stackoverflow.com/questions/5935243/mkmapview-rame-et-fuite-memoire-apple
  • Is MKMapView leaky
  • MKMapView Memory Leak in iPhone Application


来源:https://stackoverflow.com/questions/2963498/can-the-memory-used-by-mkmapview-be-released-some-how

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!