PDA

View Full Version : How to measure RAM usage?


wastedyuthe
02-13-2009, 05:02 AM
Is there a way to detect how much RAM your app is using, either in the iPhone simulator or when you transfer it to the device (when you are part of the development program)?
I can run my app in the simulator but would like to know how it is dealing with memory management.

brewstermax
02-13-2009, 06:01 AM
Is there a way to detect how much RAM your app is using, either in the iPhone simulator or when you transfer it to the device (when you are part of the development program)?
I can run my app in the simulator but would like to know how it is dealing with memory management.

I don't really know. It seems to be an impossible task, unless the SDK gives some sort of tethered read when it is hooked up. But if it doesn't crash, the iPhone has at least 5 MB left. All of them have 128 MB, so if it crashes on your device, it will on them all.

supg328911
02-13-2009, 12:02 PM
theres an app that will tell you its called free memory, i use it. it can also clear up ram too, of you under 20 megs...

idk if thats what your looking for though

bovinedragon
02-13-2009, 01:27 PM
Yes, Xcode comes with it's own profiling tools. If you have installed Xcode, search for "instruments". I think it's in the utilities folder. Also check out "shark", which it also comes with, which is a CPU profiler that is very useful.

wastedyuthe
02-13-2009, 01:28 PM
Ahh- thanks very much!

Anders
02-14-2009, 01:53 AM
Just select (in Xcode) Run -> Start with Performance Tool -> System usage

Manta Research
02-14-2009, 07:42 AM
Similar to what Anders suggested, but if you run with "Leaks" it will show all of your dynamic memory allocations. Very useful for tracking down memory leaks, or situations where your heap just keeps growing over time.