Re: Memory used by a UIImage?
Re: Memory used by a UIImage?
- Subject: Re: Memory used by a UIImage?
- From: David Duncan <email@hidden>
- Date: Mon, 7 Mar 2011 11:12:34 -0800
On Mar 4, 2011, at 8:17 PM, Rick Mann wrote:
> Unfortunately, if I create the image from a PNG, it's possible iOS stores it compressed, and only decompresses when rendering. I'd like to know how much it's using at any given moment.
If you create the UIImage with the "withContentsOfFile" APIs, then we'll reference the file for image data when necessary and may or may not be loaded into memory (generally it won't be). If you use the "withData" APIs, then the compressed data is always in memory. Using the "withCGImage" APIs will depend on how you created the CGImage itself.
But if you are trying to figure out your memory usage, it is better to use the VM Tracker instrument (part of the Allocations template). You'll have to turn on automatic sampling or press the sample button yourself to get data, but watching the "Dirty Size" statistic is what you are interested in here.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden