Memory Profiling in the iphone - iphone

Can any one guide me in clearing the memory leaks in the iphone code.
in xcode editor it does not shows any issues,
so i hav uploaded my app to the AppleStore.
they rejected my app.
so kindly help me what is my issue?
how to rectify it.
Thanks in advance

In Xcode, select Run -> Run with Performance Tool -> Leaks.
Use performance tool to help you find memory leaks.

Related

Memory management in IOS application

I am developing an IOS application and i will submit it the next week the Apple store. but i am not very good in memory management.
I would like to know what are the all tools that you use to remove all the memory erros ( leaks,...).
should i remove all the NSLogs before submit it to the store ?
What are the other things to take care before submit it to the store ?
thanks for your answers
Before submitting to the app store..
Detect all leaks, you can use
a) Leaks (xcode->instruments->leaks).
b) Static analyzer tools, if you are using newer versions of xcode (Build-> build and analyze).
c) Above all , make a thorough check yourselves, that you arereleasing all memory that you are allocing/retaining..
What the need of NSLog in a
distribution build. NSLog helps in
debug..Remove them all..
Run your app in whatever iphone
device you get..Never submit an
iphone app to store without checking
on device itself.
If your app crashed during review,
then it is surely rejected. Resolve
all bugs/crashes before submitting.
A good QC on device is a must.
This checklist might be helpful..
The static analyzer and the instruments will help you detect the leaks. Find and resolve them. Have a look at Memory management it will help to resolve leaks.
In Xcode , Instruments -> Leaks, is used basically to find out memory leaks.
Hope this helps you.

Memory Leaks tutorial in iphone

is there is any good tutorial link that can help me in the memory leaks of iphone,, b/c I am facing some problem whenever I allocate a memeory , in the dealloc I am releasing that memeory, but the problem is that when I run application in the (Run-> Run With Performance Tools -> Leaks) but I got the leaks through there.. how can I resolve it...
reply me plz
In XCode, you can run Build and Analyze. XCode shows memory leaks with arrows of you bad memory management.
This is a good tutorial : iphone-memory-management-tips

iphone app crashes?

i am running my program using iphone simulator n at some point application crashes..but there is no error...just getting Debugging terminated in debugger console
how i can check this what is the problem of crashes?
How about memory leaks?? If you are alloc-ing a lot of variables and not releasing them this can cause memory leaks. Which will in time cause the app to crash with a black screen. Try running your app with the "Leaks" tool. Go to Run -> Run with Performance Tools -> Leaks. Go through everything you can in the app with this tool running and it will inform you of any memory leaks.
Here is a good link for information about using the Leaks Instrument:
http://mobileorchard.com/find-iphone-memory-leaks-a-leaks-tool-tutorial/
Also check your code!! If you know where its crashing go and check the code and make sure your doing everything you intend to!
Try to look into crash logs. You can find them in ~/Library/Logs/CrashReporter

iPhone known memory leaks - list

Is there a list of known leaks within the iPhone SDK sitting somewhere, all alone?
I guess you would have it specified by version. (I just ran my test app - it has a leak outside the project itself (somewhere related to connections) when testing it on a v3.3.1 iPhone 3G, but the leak is not there using an iPhone 4 v4.0.2.).
It's doubtful that there's a public list of known memory leaks. If you want to know whether your leak is a known issue, your best bet is probably to search Open Radar, or to use Apple's Bug Reporter and see if you get a response.
During my short experience with the iPhone SDK, I have never encountered a memory leak caused really by the SDK. It is mostly caused by your code but has shown itself later.
It is also possible that the new SDK has improved some ways of doing things, so that your previous leaks do not occur anymore.
You need to give more details to the leak in order to help you.

iPhone: iPhone application testing

First, Thanks to all for your quick help for any questions asked in this forum.
I just want to know what are the testing tools coming up with Xcode on Mac as i need to test my iPhone application professionally (or) What do you suggest to use debug and test my application using any (or) built-in tools?
Thanks.
The first thing I try is Xcode's "Build and Analyze" menu command.
Next thing is to run Instruments and look for memory and object allocations and disposal. Instruments should keep you busy for quite a while as it can provide you a wealth of information, including network performance and graphics utilization.
When using instruments, the first method you should check is memory allocation and leaks. When your application leaks, it will spike. Click on this leak and then extend the details to find the exact whereabouts of the leak.
However read the documentation on it all first.
Documentation