activity monitor instruments ios

1k Views Asked by At

i noticed that the activity monitor usage doesn't correlate with the allocations in instruments. I understand that this is due to the fact that allocations doesn't factor in a lot of things.

I was wondering how much memory should 1 app really use. I.e what is considered reasonable? In the allocations tool, my app is running at 2.0mb heap . In the memory monitor it sometimes peak to 50 before falling back to 40. Is that normal ? I understand that the iphone's have 128mb/256mb. Isn't 40 mb quite a lot for a simple app since safari seems to be using only 35mb heap.

Thanks.

2

There are 2 best solutions below

5
On

it does seem pretty high, but that depends on what actions your app performs when these peaks appear. Are you loading in a lot of graphics? sound?

Maybe you can give a little more information as to what your app does, and when these peaks appear

0
On

Images are usually stored in some place that does not get counted by instruments. You only see a small handle to the CGImageRef, etc. Apple needs to update Instruments (it would take quite a hack..) to also include memory like this.

EG: Load 1000px by 1000 px image at 4 bytes/px ==> 4MB, but you will see 50 bytes for some CGimageRef, or similar somewhere. So also count the CGImageRefs.