So I am wondering that how accurate the leaks instrument in xcode 4 is. Should I trust it to find my all memory leaks or should I also do something else?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Leaks specifically scans all of memory and finds anything that looks like a pointer. If that pointer-like value points to an allocation, than that allocation is not leaked.
I.e. it is a very conservative scan and, thus, will often fail to report things which are effectively leaked.
More importantly, Leaks cannot report memory that is uselessly accreted. I.e. if you have a “write only cache” where you are constantly filling the cache, never reading from it, and losing the keys along the way, all that memory will not be leaks (“it is in the cache, man!”), but it is also totally useless.
For that, there is Heapshot Analysis. An example use case of which I wrote up a while ago.