Is any memory leak in iOS accepted at all?

I am new to Objective-C (from Java) and I think I am getting a pretty good understanding of memory management. But when my application loads, I get a very small memory leak that occurs only when the game loads (we are talking about 32 to 512 bytes).

This is a random case when it leaks, and it does not look like the user is launching a leak. It is usually detected after about 20 seconds to 1 minute.

The information I receive from the debugger is never the same. It used to be UIApplication, the “responsible frame”, sometimes it is [UIWindow makeKeyAndVisible], and sometimes it is [UNibDecoder].

Is this an “accepted” limit, or will the application not leak in ALL? This is my first "big" application. I made a small flipsideview application, and where there are no leaks, that would never be so.

On the other hand, what is the best way to identify leaks?

+6
memory-management ios memory-leaks
source share
2 answers

This is not great, but it will not be rejected if it does not lead to a failure before the reviewer. Size is less important than often. If this happens only once when the application starts, this is not very important. If this happens every time the user does something, then this is more of a problem.

The LLVM static analyzer may find some of these problems for you. Clear the assembly, then select Build and Analyze from the Build menu. There is also a Leak pattern in Tools.

You will probably be able to track down these errors and fix them, because Objective-C memory management is completely different from Java, and it would be nice to work a little with less materials before getting stuck trying to debug a huge problem with an impending deadline.

+10
source share

Too much shared real-time memory usage is what will cause your application to crash and / or crash. If you leak memory inside a loop or a repeating method, the leaks will eventually add up and your application will crash.

But if there is a leak, but not in a cycle or a repeating process, and the total amount is less than the typical memory usage for the application, then this may be impolite and inelegant, but there really is no way to say, and there are very few operational flaws.

I often test my applications with a targeted “leak” of several megabytes during application startup and making sure that the applications still work fine. Some of these applications have been approved for distribution in the App Store, and this leak test code is still accidentally left on (mia culpa!). But this shows that even a few MB leaks are not a problem for approving the application (if it is not enough to cause your application to crash while testing low memory).

+4
source share

All Articles