调试期间XCode 5中的内存图/图表 [英] Memory graph / chart in XCode 5 during Debug

查看:113
本文介绍了调试期间XCode 5中的内存图/图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

内存"使用情况图表在XCode 5 Debug导航器窗口中到底代表什么?

What does "Memory" usage chart/graph exactly represents in XCode 5 Debug navigator window?

我有一个iOS应用程序项目,其中ARC已禁用,并且没有storyboard/xib(即旧样式).所有内存管理都是使用保留/释放/自动释放来手动完成的.

I have an iOS app project with ARC disabled and no-storyboard/xib (i.e. old style). All memory management done manually using retain/release/autorelease.

当我在XCode 5中调试项目时,内存饼图/图形显示应用程序运行时内存使用率逐渐增加,半小时内内存占用量超过1 GB.

When I debug the project in XCode 5, the memory pie-chart / graph show gradually increasing memory usage as the app runs, exceeds 1 GB memory footprints within half hour.

大致而言,它每2到3秒保持增加0.1到0.3 MB的速度,而内存骤降/减少的幅度非常小(幅度每30秒<0.1 MB).

Roughly, it keeps increasing by 0.1 to 0.3 MB per 2 to 3 second with very rare memory dips/decrease (of magnitude < 0.1 MB per 30 seconds).

这是有关内存管理的问题(内存泄漏)吗?我进行了内存分析(通过XCode 4.6在Instruments上使用了分配/内存泄漏),但是没有发现任何泄漏.

Is this a concern (memory leak) with respect to memory management? I did memory analysis (using Allocations/Memory Leak through Instruments on XCode 4.6) but didn't find any leaks.

推荐答案

我自己找到了答案.不幸的是,我有NSZombieEnabled(僵尸对象)用于调试模式-参见下文-(菜单产品> 方案> 编辑方案)

Found answer myself. Unfortunately I had NSZombieEnabled (Zombie object) for debug mode - see below - (menu Product > Scheme > Edit Scheme)

通常,NSZombieEnabled工具甚至将释放的对象也保留在内存中,以帮助开发人员查找释放的对象.请参阅此链接-什么是NSZombie?

Typically NSZombieEnabled tool keeps even the released objects in memory to help developer find over released objects. Refer this link - What is NSZombie?

在我未选中启用僵尸对象"选项后,即使在半个小时的应用程序使用后,内存使用量也稳定在10 mb左右(并不总是增加)-见下文-

After I unchecked "Enable Zombie Objects" option, the memory usage stabilized to about 10 mb (not always increasing) even after half hour app usage - see below -

底部行-要分析内存使用情况,请确保清除"启用僵尸对象".

BOTTOM LINE - Ensure to clear "Enable Zombie Objects" when you want to analyze memory usage.

这篇关于调试期间XCode 5中的内存图/图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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