Reputation: 37534
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?
Upvotes: 2
Views: 556
Reputation: 37534
Well, it looks like I've found an answer to my own question right here on SO, it's here. This is what I wanted, testing it now to see how it performs.
Upvotes: 0
Reputation: 81878
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.
Upvotes: 1
Reputation: 81878
You can use Instruments, especially the "Object Allocations" template, to track memory usage.
Upvotes: 1