MKMapView使用的内存可以如何释放?

发布于 2024-09-04 08:42:53 字数 195 浏览 0 评论 0原文

我在 iPhone 应用程序中使用 MKMapView。当我加载此视图时,活动监视器工具显示我的应用程序的实际内存正在显着增加。当您移动地图或放大和缩小地图时,它会不断上升。一旦加载该视图的视图控制器被删除,由于使用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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浊酒尽余欢 2024-09-11 08:42:53

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

您是否使用 Instruments 检查过是否存在内存泄漏? (同样,您应该在实际设备上执行此操作,因为模拟器的行为有时会略有不同,并且在内存泄漏时会显示误报/漏报)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文