iosxcodeipadios5instruments

iOS - I receive memory warnings but have no idea why


I am developing for the iOS and checking my app with iPhone and iPad.

I receive many memory warnings (didReceiveMemoryWarning is called) but have no idea why. My app is using ~35MB in the peak points, and 4-5 MB when in the lowest point.

I tried to find leaks using instruments but could not find any critical issues.

Is there a good way to find out why the system sends memory warnings?


Solution

  • Memory warning is to be expected in an iOS app. It doesn't have to be because of your app. Other apps are still in memory even if the apps are suspended. The OS will do memory management by sending memory warning and kill apps when necessary. As long as you're using reasonable amount of memory (with little to no memory leak) and handle didReceiveMemoryWarning properly, you'll be fine.

    Also, when your app is in suspended mode, if your app is using little memory footprint, your app will more likely to survive killing process. As app with larger memory footprint will be terminated first.