How to find the source of memory pressure in an iOS application

I debugged the application on the device. It worked fine for some time, and then stopped with the error message "Application terminated due to memory pressure." No errors or crash logs.

Why did this happen? How can i solve this? My application uses 10 - 30 mb of RAM during operation. It's a lot?

UPDATE: after using the tools, I got this .. can someone explain the memory allocation ????

! []

UPDATE: I tried to use devices and found leaks. i got something like this

I can’t understand what this means and how to solve this problem?

+6
source share
1 answer

I think that from 10 to 30 mb of application memory usage is not a problem, especially for the latest models of iOS devices (for example, iPhone 4 and 5), if you do not have a large number of other intensive memory applications running in the background. They have RAM from 512 MB to 1 GB.

Diagnosis of a problem -

First, use the memory graph in Xcode 5. You may find this link useful.

Alternatively, you can add breakpoints to the didReceiveMemoryWarning method provided by the UIViewController.

And to dig further, switch to the profile of your application. (Xcode Menu Product > Profile and select Distribution in the dialog box). Here you will find a good tutorial .

+3
source

Source: https://habr.com/ru/post/957519/


All Articles