使用 iOS 的仪器:为什么内存监视器不同意分配? [英] instruments with iOS: Why does Memory Monitor disagree with Allocations?

查看:21
本文介绍了使用 iOS 的仪器:为什么内存监视器不同意分配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从仪器的屏幕截图中可以看出,Allocations 认为我的应用程序 (Ongo) 仅使用了 7.55 MB 的内存,而内存监视器显示为 53.30.此外,可用系统内存与应用程序使用的内存量几乎没有相关性.有谁知道为什么这两个工具之间存在如此大的分歧?此外,是否有可能找到系统内存不足的来源或如何防止它如此快地耗尽?我的应用程序似乎没有泄漏内存,但不知何故它正在耗尽系统资源.

As can been seen in this screen shot from instruments, Allocations thinks my application (Ongo) is only using 7.55 MBs of memory, while Memory Monitor says 53.30. Further more the free system memory has little to no correlation to the amount of memory that the app is using. Does anyone know why there is such a big disagreement between these two tools? Additionally is it possible to find the source of the low system memory or how to keep it from running out so quickly? My app doesn't appear to be leaking memory but somehow it's exhausting the system resources.

谢谢

推荐答案

对于 2012 年后看到这篇文章的人:

For those who sees this post after the year 2012:

真正加载到设备物理内存的内存是VM Tracker Instrument中的Resident Memory.

The memory really loaded into device's physical memory is the Resident Memory in VM Tracker Instrument.

Allocation Instrument 只标记 malloc/[NSObject alloc] 和一些框架缓冲区创建的内存,例如,解压后的图像位图不包含在 Allocation Instrument 中,但它总是占用您的大部分内存.

Allocation Instrument only marks the memory created by malloc/[NSObject alloc] and some framework buffer, for example, decompressed image bitmap is not included in Allocation Instrument but it always takes most of your memory.

请观看 WWDC 2012 Session 242 iOS App Performance: Memory 从 Apple 获取信息.

Please Watch WWDC 2012 Session 242 iOS App Performance: Memory to get the information from Apple.

这篇关于使用 iOS 的仪器:为什么内存监视器不同意分配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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