Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an iOS application receive a memory warning in the background?

When an application is in the background and another application is running and is requiring more memory, can the app in the background receive a memory warning? Or can it only get killed from the memory without any warning?

If it's the latter, should I manually free up memory (cache) in the "applicationDidEnterBackground" method so that there is less chance that it will get killed?

Thank you very much!

like image 760
ifvc Avatar asked Jan 09 '11 19:01

ifvc


1 Answers

Yes, your application can receive a memory warning while in the background. Your application only gets killed immediately if the system really needs the memory, but it'll play nice and ask your application to return memory on its own first. If the system is satisfied it won't kill your application.

like image 196
BoltClock Avatar answered Nov 04 '22 16:11

BoltClock