Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 17. Memory Management > Finding Memory Leaks

Finding Memory Leaks

As you develop more sophisticated applications you will find that you may end up in situations where your memory usage continues to grow as your application continues to execute. This can be caused by objects that you created but forgot to release. The problem is figuring out how to find those objects so you can correct the problem. By selecting the Analyze option from Xcode’s Product menu, you can have your code analyzed for various problems. Among the things this analyzer is capable of detecting is simple memory leaks. For example, it can find an object you alloc’ed but forgot to release. So try that first.

If the analyzer doesn’t help, you should learn how to use Instruments. Instruments is a very powerful tool that can, among other things, monitor your application’s memory allocation while it’s running and help track down memory leaks. Apple has a user guide for using Instruments that you can refer to in order to get started using this powerful tool.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint