是否可以在启用断点的情况下使用 XCode 的 Instruments?
我正在尝试优化 iOS 应用程序的内存使用情况,并且我想查看应用程序在代码中特定点的总内存使用情况。我想我应该能够设置断点,使用活动监视器分析应用程序,然后查看每个断点捕获时的内存使用情况。但是当我运行 Instruments 时,断点似乎不再停止执行,因此很难准确知道内存使用情况何时发生变化。
是否可以同时使用断点和仪器?如果没有,是否有一种巧妙的方法可以编写一些代码,以便在发生特定事件时将标记插入到仪器时间线中?
I'm trying to optimize the memory usage of an iOS app, and I'd like to see what the app's total memory usage is at specific points in the code. I was thinking I should be able to set breakpoints, profile the app with Activity Monitor, and just look at the memory use when each breakpoint catches. But when I run Instruments, it seems breakpoints no longer stop execution, so it's hard to know exactly when memory usage is changing.
Is it possible to use breakpoints and Instruments at the same time? If not, is there a clever way of writing some code to insert a marker into the Instruments timeline when specific events occur?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我今天也遇到了这个问题,经过一番搜索后找到了解决方案。以下文字摘自该帖子:
参考:http://www.cimgf.com/2008 /04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/
I also ran into this issue today, and after a bit of searching I found this solution. Text below is a quote from the post:
Reference: http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/
嗯,您没有在调试器的控制下运行。
一种方法可能是在关键点添加警报,然后(手动)进行统计。
或者可能有一些 dtrace 魔法。
Well, you aren't running under control of the debugger.
One approach might be to add alerts at the key points, and take a heapshot then (manually).
Or there may be some dtrace wizardry.