views:

41

answers:

2

I'm working with an iPhone 3G, and when I'm trying to investigate memory leaks using the LEAKS instrument, my app crashes. It does not crash when LEAKS is not used.

I'm making no claim to having a bug-free or non-memory-intensive app here. But I'd like to investigate leaks on an actual device. When I'm running LEAKS it is incredibly slow.

Are there still developers working on iPhone 3G? I don't want to be the whiny guy blaming his tools, but I'd also like to be sure the whole dev world hasn't moved on to iPhone 3GS and I'm the only one trying to run both my app and leaks on a 3G.

Currently running iOS 4.0 "gold". Snow Leopard dev env with latest XCode.

A: 

Hi Gordon, the number 1 tool is probably the static analyser, which you have since you have Snow Leopard/latest Xcode. Just hit shift-command-A to run and click the blue boxes in build results to see object lifecycle and leakage. You're not using NSZombieEnabled and Leaks at the same time are you?

Maybe the crash comes as a result of instrumenting the build so that Leaks can do its job. Getting a clean analyser build may well improve things to the point where you can run under Leaks. Generally these days I consider a clean analyser build a very good indication that I've done all the leak chasing I need to - while Leaks might show more on occasion I have yet to find anything with Leaks that was not also reported by the analyser.

It shouldn't matter that you are running on a 3G rather than a 3GS, I often work with an "old" 3G - the one nobody wants to carry and so it is set aside as the development phone - and from a development point of view there really isn't much difference.

Adam Eberbach
A: 

Your problems with the Leaks instrument may be due to the frequency at which it is scanning for leaks in your application. These periodic slowdowns may be causing problems with the execution of your application.

You can disable automatic leak checking by selecting the Leaks instrument and unchecking the Automatic Leaks Checking option on the lower right. When you are ready to check for any leaks that may have accumulated, click on the Check for Leaks Now button below that checkbox option.

Brad Larson