objective c - Why am I having memory leaks using Instruments on the device but not on the simulator -
I'm getting close to ending the release of my application and using the tool to fix any memory leaks I am trying to
How am I using the iPhone Simulator, but how can I get a memory leak when using Instruments and My device? I think this is a high level question, but I do not think posting any code will help in any way (very few codes ...).
And what tool is it possible to point to the source code, where it seems to leak? I can do this while using the simulator, but it seems that it does not work when using it for the device (objects know that I show it while playing for simulator) it looks like what the object is Is, setup problems?)
Thanks in advance!
Regards, Nicklus
Update: Is there something like this that OSX is collecting automatic garbage but is not iOS?
Trust only the device. Your user will be used to run your application. Do not trust the simulator.
As a demonstration of this, I intentionally added a leak to a project. The leak was not detected in the simulator, but the device was shown as expected. This simulator is this: simulator. It may be useful to work fast, but the device is never replaced.
Once the tool shows you a leaking object, you can double click on it. This will show part of your code responsible for the leak. It works for simulator and device.
When you compile for the device, make sure that you are in debug mode (and the settings have kept all of your symbols for this mode).
Some more tips that may be useful to you:
For more fluid sessions, disable "automatic leak detection" and if appropriate, manually Press the "Check Now Leak" button from
The "Build and Analyze" command will do a great job to help you find a leak. This (completely) is not magical, so it will not get all the leaks. For example, IVR leaks will not be identified. But for the scope of any method, it is very awesome.
I recommend activating the "Run Static Analyzer" flag in your build settings (or if you are slow to compile machines for release mode only).
If you need more information about how to use the device to find leaks, then read this Apple Dock: and
you can also watch the videos of WWDC related sessions.
If you still do not understand where your leak comes from, read its time (again).
Thank you for shiping a leak-free application. With iOS 4, it is now more important than ever.
Comments
Post a Comment