How can I find out how much memory does my Iphone app occupy in any given moment from within the app itself? I'm interested in this on the device, not in the simulator. Is it an API to call for that? As another approach, how can I find out how much free memory does the device have at a given time?
Asked
Active
Viewed 544 times
3 Answers
1
You can use Instruments, especially the "Object Allocations" template, to track memory usage.

Nikolai Ruhe
- 81,520
- 17
- 180
- 200
-
I'm interested in a solution from within the app itself... to be able to display it on the screen. – luvieere Sep 22 '09 at 08:36
1
Memory usage is a bit complicated, since there is no easy number to determine. See here why.
But libtop for Mac OS is open source and you can have a look into it to find out how top measures things. I once did this on a project which monitored its memory consumption and found it quite useful.

Nikolai Ruhe
- 81,520
- 17
- 180
- 200