简体   繁体   中英

How Find the Source of Memory Pressure in an iOS Application

I was debugging an app on a device. It worked perfectly for some time and then stopped with the error message "App terminated due to memory pressure". There is no error or crash logs.

Why did this happen? How can i resolve this? My app uses 10 to 30 mb ram while running. Is that a lot?

UPDATE: after using instruments i got this.. can anybody explain memory allocation????

![]

UPDATE: i tried instruments and found leaks. i got some thing like this

i cant understand what does it mean and how to solve this????

I think 10 to 30 mb of app's memory usage is not an issue especially for latest model iOS devices (like iPhone 4 and 5), unless you have lot of other memory intensive apps running in background. They have 512mb to 1 GB RAM.

Diagnosis of issue -

To begin with, use memory graph in XCode 5. You may find this link useful.

Also, you may like to put breakpoints in didReceiveMemoryWarning method provided by UIViewController.

And, to further dig down, switch to profile your app. (Xcode menu Product > Profile and choose Allocations in the dialog). Here, you will find a good tutorial .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM