MKMapView使用的内存可以如何发布? [英] Can the memory used by MKMapView be released some how?

查看:81
本文介绍了MKMapView使用的内存可以如何发布?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPhone应用程序中使用 MKMapView 。当我加载此视图时,活动监视器工具显示我的应用程序的实际内存显着增加。当您移动地图或放大和缩小时,它会不断上升。删除加载此视图的View控制器后,由于使用 mapView 而分配的内存不会被释放。有没有什么可以做到让所有这些记忆恢复?

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?

推荐答案

这是在模拟器上,还是在实际设备上?模拟器的某些部分与实际设备的行为略有不同,模拟器可能无法正确清除缓存(因为与iOS设备相比,它不需要在Mac上提供大量的RAM)。

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)

这篇关于MKMapView使用的内存可以如何发布?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆