I am new to Objective-C (coming from Java) and I think I am getting a pretty good understanding of memory management. But when my app loads, I get a extremely small memory leak, that only occurs when the game is loading (we are talking about 32 to about 512 bytes).
It's random when it leaks, and it doesn't seem like it's the user that triggers the leak. Normally it is detected after about 20sec to 1min.
The information I get from the debugger is never the same. Sometime it's UIApplication thats "responsible frame", sometimes it's [UIWindow makeKeyAndVisible] and sometimes it's [UNibDecoder].
Is this bellow a "accepted" limit, or should the app not leak at ALL? This is my first "big" app. I have done a minor flipsideview app, and there where no leaks what so ever..
On the other hand, what is the best way to identify leaks?
It's not great, but it won't get your app rejected unless it causes a crash in front of a reviewer. The size is less important than how often it occurs. If it only occurs once every time the app is run, that's not a big deal. If it happens every time the user does something, then that's more of a problem.
LLVM's static analyser can find some of these problems for you. Clean your build, then select
Build and Analyze
from theBuild
menu. There's also a Leaks template in Instruments.It's probably a good idea for you to track down these bugs and fix them, because Objective C memory management is quite different compared to Java, and it's good to get some practice in with smaller stuff before you're stuck trying to debug a huge problem with a deadline looming.