What level of memory usage will trigger an iOS memory warning?

My application can consume tens of MB of memory, and in rare cases it reaches 100 MB. Do I need to worry about memory warnings and implement didReceiveMemoryWarning() ? And how much time do I have for releasing memory? (I need to save the data in memory to the hard drive.)

Suppose I target devices after iPhone 5.

+7
ios memory swift
source share
1 answer

First of all, here is a discussion of the didReceiveMemoryWarning method from Apple docs .

DISUCSSION

An application never calls this method directly. Instead, this method when the system determines that the amount of available memory is low. You can override this method to free up any additional memory used by your controller. If you do, your implementation of this method should call the super implementation at some point.

According to this reddit thread, even if you process this event, your application can still be terminated to provide space for running applications.In addition, often all didReceiveMemoryWarning applications on the device call not only yours.

I hope this answer is ok as this is just a comment quoting the documentation :)

+8
source share

All Articles