Why does my application get didReceiveMemoryWarning and get killed, although the memory is constant and enough memory is available?

I have weird effects with my application. I have implemented my own PDF viewer. It shows one page at a time. Using the Activity Activity Monitor tool, I see that my real memory is constantly around 50 MB. After switching the pages back and forth a couple of times, I get a memory warning level of 0. I do my best to respond to this and sacrifice the low-resolution background image that I show first to show something until CATiledLayer catches up. Does not help. A few pages later I get a warning about memory levels 1 and 2, and after several pages my application is killed with a reason of "9". Memory NEVER exceeds 50 MB!

Why do I receive these warnings in the first place? There is enough memory.

This happens on an iPad running iOS 4.3.

+5
source share
1 answer

I don’t think that there is something mysterious here, which I’m sure is not what you wanted to hear. Absolute digits of the "safe" amount of memory do not exist. Rule: when the OS tells you that you use too much, use less. At first it will discard background processes and is preferable to your foreground application, but there are still limitations.

In the "old days" you are lucky to get 20 MB. I'm sure you can safely get more than on the iPad, but apparently less than 50 MB.

, , , , . "" ( "" ), , , , , .

+2

All Articles