检查iOS应用程序在仪器中使用的内存 [英] Checking iOS application used memory in instruments

查看:93
本文介绍了检查iOS应用程序在仪器中使用的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确保正在正确阅读分配插件。我正在测试一款接收内存警告的iPad应用程序1,2& 3.
我想知道我的应用程序当前耗尽的内存,我认为它必须是Live Bytes列?它将 All Allocations 标记为2.42 MB我觉得它很低。

I want to make sure I'm reading the allocations plug in correctly. I'm testing an iPad app thats receiving memory warnings 1,2 & 3. I want to know the current used up memory from my app, which I think it has to be the "Live Bytes" column? which marks All Allocations to 2.42 MB which I think its low.

其他列报告的是什么? #Transitory,整体字节?
此外,如果我的应用程序仅使用3 MB的内存,如果我在没有发布的情况下获得内存级别3警告就会被杀死吗?

What do the other columns report? #Transitory, Overall Bytes ? Also if my app uses only 3 MB of memory can it be killed if I get a memory level 3 warning without releasing?

谢谢。

推荐答案

请勿使用对象分配工具查看总内存使用情况。由于我在答案中推测的原因,它没有显示应用程序的真实总内存大小这里

Don't use the Object Allocations instrument for looking at your total memory usage. It does not display the true total memory size of your application, for reasons that I speculate about in my answer here.

相反,将Object Allocations与Memory Monitor工具配对,后者使用将显示您的应用程序的真实总大小。我愿意打赌它比你在Object Allocations中看到的2.42 MB更大(例如,根据ObjectAlloc,我有一个具有700k内存使用量的应用程序,但它的实际大小在内存中约为25 MB)。如果您在iPad上收到内存警告,那么您的应用程序可能会占用相当多的内存。

Instead, pair Object Allocations with the Memory Monitor instrument, the latter of which will show the true total size of your application. I'm willing to bet that it's way larger than the 2.42 MB you're seeing in Object Allocations (for example, I had an application with 700k of memory usage according to ObjectAlloc, but its actual size was ~25 MB in memory). If you are receiving memory warnings on an iPad, your application is probably chewing up quite a bit of memory.

对象分配对于告诉您内存中的内容非常方便,但它不是这些物品大小的准确指标。它也是一个很好的工具,通过使用堆射功能(仪器左侧的标记堆按钮)显示分配对象的稳定增加。

Object Allocations is handy for telling you what you have resident in memory, but it's not an accurate indicator of the size of those items. It's also a great tool for showing you steady increases in allocated objects by using the heap shot functionality (the "Mark Heap" button on the left-hand side of the instrument).

这篇关于检查iOS应用程序在仪器中使用的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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