views:

37

answers:

1

I am testing my app in two different devices. My app is relies heavily on images(allocating and deallocating). I know I have a leak but I am just curious why I observe this.

The behavior between the two devices is different. Device A crashes after 4 cycles of switching between views and Device B after 10 cycles, yet Device A has more free memory than Device B.

             Device A:               Device B:
Type         iPhone 3G 16GB          iPhone 3G 8GB
Capacity     14.64GB                 7.08GB
Audio        5.32GB                  1.18GB
Video        48.8GB                  -
Photos       267.3GB                 46.8GB
Apps         1.08GB                  505.5MB
Other        343.9MB                 370.7MB

Free         7.60GB                  5.0GB

Any insights why this is the case?

+4  A: 

I am not sure if I understand this correctly, but the figures on the last row (7.6/5 GB) refer to available flash memory, not to the RAM. Therefore they say nothing about the expected performance of a memory-intensive application. Neither the amount of free RAM is exactly telling, because the system will start killing large applications when the memory is scarce and the amount of free memory will go up.

zoul
I supposed that RAM in all iPhone 3G's is 128MB(3GS 256MB). So I ruled that out as a factor.There is no multitasking in iphone, I guess. So if the iPhone is running only one application, why should the performance be different in two devices of the same RAM?
erastusnjuki
Yes. The figures in the last row represent hard-drive memory. Is there any way to check RAM?
erastusnjuki
Yes, Instruments is your friend. See Run → Run With Performance Tool → Object Allocations and others. There is also a Leaks instrument that can help you find the leaks.
zoul
There is multitasking on iPhone, you just are not allowed to use it. There are many processes running all the time, possibly including the factory Mail.app, Safari, iPod and others. The actual amount of free memory can differ between devices of the same type and configuration.
zoul
Instruments doesn't show me total RAM memory capacity it shows percentages. Is that what can help me see whether the RAM between the two devices is different?
erastusnjuki
any references on the multitasking point?
erastusnjuki
The multitasking point can be easily seen in the process list in Instruments. There are quite a few processes running along with your app. The amount of free RAM is always different on two different devices – it depends on the pages you have displayed in Safari and many other things. You could probably eliminate this difference by restarting the device.
zoul
If you use the Memory Monitor instrument in Instruments, you will get an exact readout of the memory usage of your application, as well as all other processes on the device.
Brad Larson