Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable Visual Memory Debugger in Xcode 8?

I migrated a project from the previous version of Xcode to Xcode 8. What I want is to use the new visual memory debugger. It's available in new projects, but is entirely missing in my imported one. Why is this?

like image 454
PopKernel Avatar asked Jun 14 '16 22:06

PopKernel


People also ask

How do I see memory management in Xcode?

Inspect the debug memory graph You can generate a memory graph of the objects and allocations in your app by clicking the Debug Memory Graph button in Xcode's debug area at the bottom of the workspace window. The memory graph shows the memory regions your app is using and the size of each region.

How do I debug memory leak in Xcode?

Diagnose the Memory LeakChoose “Xcode” in the top left of the screen. Expand “Open Developer Tool,” and select “Instruments” Now choose “Leaks,” and make sure you have chosen your target app and device at the top (“Choose a profiling template for…”):

How do I debug memory usage?

The Diagnostic Tools window appears automatically unless you have turned it off. To bring up the window again, click Debug > Windows > Show Diagnostic Tools. Choose Memory Usage with the Select Tools setting on the toolbar. Click Debug / Start Debugging (or Start on the toolbar, or F5).

How do I debug in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.


2 Answers

It appears that Swift 3 is required for Visual Memory Debugger to work.

My app migrated to Swift 2.3 did not work, when I tried migrating it to Swift 3.0 it worked instantly.

The runtime sanitization checkbox is not required for visual memory debugger to work, however the reason that it is disabled is the same.

like image 166
gabriellanata Avatar answered Nov 09 '22 15:11

gabriellanata


It seems like the project requires Swift 3 to enable Adress & Thread Sanitizer (which is the Memory Debugger).

address sanitizer thread sanitizer

For me this applies to both iOS & OS X/macOS apps. Both written in Swift 2.2 & converted to 2.3.

Note: I only tested this on OS X El Capitan 10.11.5.

@gabriellanata confirms that it works when the code is converted to Swift 3.

like image 25
mangerlahn Avatar answered Nov 09 '22 17:11

mangerlahn