My app may consume tens of MB of memory, and in rare cases it reaches 100MB. Do I need to worry about memory warnings and implement didReceiveMemoryWarning()
? And how much time do I have to release memory? (I need to persist the data in memory to the hard drive.)
Suppose I target devices after iPhone 5.
First off, here's the discussion of the method didReceiveMemoryWarning
from Apple docs.
DISUCSSION
Your app never calls this method directly. Instead, this method is called when the system determines that the amount of available memory is low. You can override this method to release any additional memory used by your view controller. If you do, your implementation of this method must call the super implementation at some point.
As per this reddit thread, even if you handle this event, your application can still be terminated to give space to the running applications. Also, often times all of the apps' didReceiveMemoryWarning
on the device are invoked, not only yours.
I hope this answer is okay since this seems just a comment quoting the documentation :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With