Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way of solving memory leaks on the iphone?

Please suggest the best way of solving memory leaks on the iphone. What is the best use of release, autorelease, retain and which cases do each apply?

like image 502
Hiren Gujarati Avatar asked Dec 23 '22 06:12

Hiren Gujarati


1 Answers

You can track memory leaks with Instruments: see this tutorial.

If you're familiar with Valgrind, you use it on x86 binaries built against the iPhone Simulator SDK: see how Landon Fuller does it.

EDIT: Another Stackoverflow answer suggests the Clang analyser: static analysis of the code may detect memory allocation errors as well. I never used this tool myself but it's good to know it's possible.

like image 121
Gregory Pakosz Avatar answered Mar 07 '23 04:03

Gregory Pakosz