0

I am having some trouble around memory leaks in my app. I just wanted to know that whether it is possible to identify how much memory allocated by my app on heap so that i can reduce my resources accordingly. I know that system gives low memory warnings & i can clean up my data there but even if sometimes it wont happen. If i get to know that my app is reaching maximum memory & remaining size on heap so i could be better to reduce my resources.

Thanks in advance....

iSagar
  • 107
  • 1
  • 11
  • maybe you can look at this – user1550903 Jul 25 '12 at 07:59
  • Hey thanks but i wanted to know in run time app not using Instruments. Is there any constant or a Flag by iOS that retrieves heap allocations by my app? – iSagar Jul 25 '12 at 08:46
  • possible duplicate of [How to Programmatically Tell How Much Memory an iOS App is Using?](http://stackoverflow.com/questions/5046711/how-to-programmatically-tell-how-much-memory-an-ios-app-is-using). Also http://stackoverflow.com/questions/4579642/monitor-memory-usage-in-an-iphone-app (which actually has answers). – Thilo Jul 25 '12 at 09:02
  • Another take on this https://stackoverflow.com/a/20402404/1633251 – David H Aug 16 '22 at 14:32

2 Answers2

0

Use Instruments. Command-I in XCode to profile your app in Instruments.

benjammin
  • 537
  • 5
  • 23
0

Yes of course, I would recommend the instrument's tool "Leaks". It lets you know how much memory allocates your app, and if there are leaks it tells you what they are, when and were it was allocated (and obviously not released).

Here is a nice guide I used some time ago. http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/

Jorge Aguirre
  • 2,787
  • 3
  • 20
  • 27
  • Hey thanks but i wanted to know in run time app not using Instruments. Is there any constant or a Flag by iOS that retrieves heap allocations by my app? – iSagar Jul 25 '12 at 07:24