Enable Stack Logging in Xcode

Hemant Soni
2 min readMay 31, 2020

--

Guys, we all want’s to improve the performance of the app and at that time when you are getting memory pressure or you found that application is taking too much memory then you just start digging into your code and try to find out exact things that are causing memory issues but still, it is very difficult to check each and every line of code so Xcode provides a very important tool that is memory graph debugger to find out exact memory leaks cause.

But we need to enable Malloc Stack Logging first that will give the Xcode memory debugger the ability to find the exact lines of code that are causing memory leaks.

In this tutorial we are just going to Enabling Malloc Stack Logging:

Step 1: First of all, we need to edit the scheme.

Step 2: In the Run schema: there is Malloc scribble and Malloc stack options under the Memory management section we need to check this to allow Xcode to find out exact memory leaks using memory graph debugger and one more thing we need to select All Allocation and Free History for Malloc stack.

As you can see the image below:

Now you have upgraded memory debugger and you just need to click on Memory debugger icon to start to find memory leaks in your current project.

In the next tutorial, you will get more detailed information on debugging Memory leaks using Memory Graph Debugger.

Thanks for reading and I hope you enjoyed the article. Happy debugging!

--

--

Hemant Soni
Hemant Soni

Written by Hemant Soni

Sr. iOS Application Developer

No responses yet