• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory used by a UIImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Memory used by a UIImage? (From: Rick Mann <email@hidden>)
 >Re: Memory used by a UIImage? (From: Steve Christensen <email@hidden>)
 >Re: Memory used by a UIImage? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Setting a delegate on a UITextField
  • Next by Date: easy way to store table-like data
  • Previous by thread: Re: Memory used by a UIImage?
  • Next by thread: Question about Cocoa leaks
  • Index(es):
    • Date
    • Thread