Can I use Xcode Instruments with breakpoints enabled?

I am trying to optimize memory usage in an iOS application, and I would like to know what the overall memory usage of the application is at certain points in the code. I thought I could set breakpoints, profile the application using Activity Monitor and just look at memory usage when each breakpoint catches. But when I run the Tools, it seems that breakpoints no longer stop execution, so it's hard to know exactly when memory usage is changing.

Can breakpoints and tools be used at the same time? If not, is there a smart way to write code to insert a marker into the tool timeline when certain events occur?

+7
source share
2 answers

I also ran into this problem today, and after a short search I found this solution. The text below is a quote from the message:

Breakpoints are not interrupted. The tools use debug information from however your debug build, however, does not stop at the break points you set. This is because when you load your application into Tools from the menu in Xcode, the tools simply use the path of the current executable as the starting path and download it from the Xcode from the outside. The menus in Xcode are really available for the convenience of the mechanism. This is not a big deal, as you can always run Debug mode again after a session of your tools, if you want your application to break. It just needs to be noted.

NSLog statements do not appear in the debugger console. . If you want to see NSLog instructions, you will need to download the system console application (/ Applications / Utilities / Console).

Link: http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/

+8
source

Well, you are not running a debugger.

One approach may be to add alerts at key points and then take a picture (manually).

Or maybe some kind of dtrace skill.

0
source

All Articles