Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking Memory Usage While Application is Running

While running my app, I sometimes get Memory Warning. It doesn't always happen in same place in the code, but I suspect it has something to do with memory allocated from outside of my app; i.e. if there are many applications running on the iPhone in the background I will get the memory warning earlier, and if there are no applications running in the background I will not get the warning at all.

  1. Is there a method I can use to check how much memory my application is using at a certain point?
  2. Is there a method I can use to check how much memory the machine (iPhone/iPad) is using at a certain point? maybe even to check how much memory is still available to use?
  3. In general, maybe somebody knows where I can find data about the memory limitations for the different iOS based machines?

Thanks, Ohad

like image 540
Ohad Regev Avatar asked Jun 22 '11 11:06

Ohad Regev


1 Answers

Using Instruments you can check how much memory your app is using. In Xcode4, use 'Profile' build, choose Leaks, then click the Library button in the toolbar and add the Memory Monitor instrument.

It will show an overview of every app that is running and how much memory each is using.

like image 61
Pieter Avatar answered Sep 19 '22 11:09

Pieter