Recently - and with an increase in frequency - I saw the same error message ("Terminated due to a memory error") every time I started a project from Xcode, after almost exactly one minute of runtime, even if I don’t touch application after its launch.
I did not see:
- Any unexpected memory consumption when starting with the profiler.
- Any obvious patterns in case of termination of the application (except for how long it took, but it took some time to find out).
- Any error message "Application termination due to an uncaught exception" or a stack trace in the console.
- Exception throws (exception: exception: all; break: on throw).
- Any zombie objects.
In addition, I saw that the application unexpectedly appears when the application starts in debug mode - without accidentally switching to Springboard if I restarted the application from the device immediately after its completion.
I was going to ask a similar question, detailing all these features and asking how on earth I can solve the problem.
Then I had a moment and noticed two warnings about memory on the console, although the profiler did not detect any memory problems.
Zombies When I disabled Zombie objects, the memory warnings disappeared and the application no longer spontaneously terminated.
Edit:
After 10 months, I discovered a different situation when this could happen. It turned out that an infinite while could also do this:
while (result==nil) { result = [collectionView indexPathForItemAtPoint:testPoint]; testPoint = nextTestPoint(); // After about 12 seconds, at which point this is several tens of thousands of pixels off the edge of the screen, the app dies from "Memory error" }
BenRW May 13 '14 at 13:19 2014-05-13 13:19
source share