Reputation: 3103
I'm using instruments to analyze my memory usage in an iPhone app I am developing. I was wondering, what is a reasonable memory allocation size?
When I get info on my target, am I suppose to check the boxes to ignore "NS", "CF", and "Malloc" prefixes or not? When I don't ignore them I get what seems like a pretty large value for overall bytes at startup of around 47MB, although live bytes is only about 6MB. When I do ignore the prefixes, I'll get about 1MB overall, and 350KB live. What would be a good reason to ignore or not ignore the prefixes? What is the difference, here, between overall and live bytes?
And lastly, in what ways can I go about decreasing my application's memory footprint, if need be?
Upvotes: 3
Views: 1353
Reputation: 66
The check boxes to ignore NS, CF, or Malloc merely allows you to filter down to different subsets of the total allocations. Whether or not you check them depends on what you're looking for. Obviously, leaving them all unchecked gives you the most comprehensive view, but if you're looking for something specific, you may want to ignore the other categories.
The "Live" data is what hasn't been released, whereas "overall" is everything you've ever allocated, even if it has been released.
Be aware that the "Allocations" tool only gives you a view of the heap memory you've used. This is pretty narrow. Your app uses memory for directly and indirectly for other things as well. In addition, memory fragmentation can cause your total memory usage to be much higher than it appears in the allocations tool, since memory is provided in 4k pages by the OS.
You should use the VM Tracker tool to see your apps total memory usage.
Upvotes: 5