使用工具“分配”使用 iPad 应用程序
我的 iPad 应用程序出现问题。跑了大约之后。 15分钟后,崩溃并显示“程序收到信号:“0”。显示在日志文件中。从谷歌,我发现这可能是一个内存使用问题。在 iPad 上的控制台日志中,崩溃前还出现了一些内存警告,这似乎证实了这一点。
我已经在 Instruments 中运行了我的应用程序(xcode“运行”->“使用性能工具运行”->“分配”)。这是我开始有点困惑的地方。仪器向我显示“实时字节数”和“总体字节数”。据我了解,“实时字节数”是应用程序的实际内存“占用量”,“总体字节数”是已分配并随后释放的所有内存的总数。在我的应用程序中,“Live Bytes”大约位于。 1.5 MB,而“总体字节数”逐渐上升到 500 MB,此时应用程序崩溃。
我的问题是我的应用实际使用了多少内存?对于 iPad 来说,500 MB 显然是一个问题,但 1.5 MB 显然不是。
谢谢斯图尔特
I've got an issue with my iPad app. After running for approx. 15 minutes, it crashes with "Program received signal: “0". showing in the log file. From Google, I've discovered this is probably a memory useage problem. In the Console log on the iPad there's also a couple of memory warnings before the crash which seem to confirm this.
I've run my app in Instruments (xcode 'Run' -> 'Run with Performance Tool' -> 'Allocations'). This is where I start to get a bit confused. Instruments shows me 'Live Bytes' and 'Overall Bytes'. As I understand it, 'Live Bytes' is the actual memory 'footprint' of the app, and 'Overall Bytes' is the total count of all the memory that's been allocated and subsequently released. In my app, 'Live Bytes' sits at approx. 1.5 MB, while 'Overall Bytes' gradually rises to 500 MB at which point the app crashes.
My question is how much memory is my app actually using? 500 MB certainly seems like a problem for an iPad, but 1.5 MB certainly doesn't.
Thanks
Stuart
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要实际读取应用程序使用了多少内存,请不要使用对象分配工具,而应使用内存监视器。后者将给出整个应用程序的实际内存大小。
对象分配的伟大之处在于使用新的堆快照功能来确定您正在积累哪些对象。我强烈建议阅读 Bill Bumgarner 的 有关该主题的文章。
For an actual reading of how much memory your application is using, don't use the Object Allocations instrument, but instead turn to the Memory Monitor one. The latter will give the actual in-memory size of your total application.
Where Object Allocations is great is for determining which objects you are accumulating using the new heapshot functionality. I highly recommend reading Bill Bumgarner's article on the subject.