Xcode的Debug Navigator是否与Instruments分配不同? [英] Does Xcode's Debug Navigator work different from Instruments allocations?

查看:240
本文介绍了Xcode的Debug Navigator是否与Instruments分配不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的应用程序中发现内存问题.

I'm trying to find memory issues in my app.

当我使用Xcode的调试导航器解决内存问题时,我发现该应用程序的整体使用率有所增加.对于特定的流程,当我来回走动时,我看不到内存持续存在.

When I use Xcode's debug navigator for memory issues I see increase in the overall usage of the application. For a specific flow, when I go back and forth I don't see memory being persisted.

但是,如果我使用分配使用相同的流程和工具,则每次来回移动时都会看到3Mb持续存在.

However if I go through same flow and instrument using Allocations, I do see 3Mbs getting persisted every time I go back and forth.

Xcode的调试导航器是否不可靠,或者它们正在测量不同的东西?!

Is Xcode's debug navigator not reliable or they're measuring something different or something else?!

因此有人告诉我,差异是由于构建配置所致.好的.但是,如果我去编辑方案"并将生成配置更改为发布"并在我的设备上运行.然后,我可以期望Xcode调试导航器能够正常工作吗?还是还有一些区别?如果可以的话?

So I've been told the difference is due to the build configuration. OK. But if I go and 'edit scheme' and change the build configuration to 'release' and run on my device. Can I then expect the Xcode debug navigator to work the same? Or still there are some differences? If so what?

推荐答案

Xcode的调试导航器是否不可靠,或者它们测量的是不同的东西

Is Xcode's debug navigator not reliable or they're measuring something different

绝对可以!正如我在这里多次建议的(例如,此处),您必须从不得出真实结论从调试导航仪中获取.内存分配在模拟器的调试版本中的工作方式完全不同.如果您想知道应用程序内存的工作方式,则必须使用Instruments才能获得发行版本,并且必须在设备上运行,以使内存使用情况反映实际情况.

Absolutely yes! As I have advised here many times (here for example), you must never draw real conclusions from the debug navigator gauges. Memory allocation works completely differently in a debug build in the simulator. If you want to know how your app's memory works, you must use Instruments so that you get a release build, and you must run on a device so that your memory usage reflects real-world conditions.

但是,如果我去执行编辑方案"并将构建配置更改为发布" ...那么我能期望Xcode调试导航器能够正常工作吗

But if I go and 'edit scheme' and change the build configuration to 'release' ... Can I then expect the Xcode debug navigator to work the same

绝对不会!发布意味着执行了各种编译器优化,这使得调试器几乎无法使用.但这没关系;您永远不会调试 并使用仪器同时测量任何东西.

Absolutely no! Release means all sorts of compiler optimizations are performed that make the debugger almost impossible to use. But that doesn't matter; you would never debug and use Instruments to measure anything at the same time.

这篇关于Xcode的Debug Navigator是否与Instruments分配不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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