iphone - Displaying a big image in a small frame UIImageView still costs much memory? -


i have several big images size of 1.5 mb. display each of them in uiimageview uiviewcontentmodescalefit.

the frame size of uiimageviews 150 * 150.

my question is

i understand if display big images full screens, memory go tremendously.

but if in small uiimageview, still cost memory?

thanks

they won't cost in terms of frame buffer memory (i.e. memory holding pixels display), holding unscaled images in memory still incur sizeable cost. if 1.5mb compressed size. that's high (ios uses approximately 4 bytes * width * height per image store uncompressed uiimages). such images interact poorly automatic memory management kernel perform when app goes background - backing stores released when memory pressure occurs, backing image isn't.

the best way work out if problem (and if should resize them yourself, store smaller versions, , release large ones) run app through instruments using vm tracker. if regions storing images excessive, you'll able diagnose them, , pick appropriate solution. might view wwdc 2011 session on ios memory management, goes image memory usage in detail, including using instruments find problems.

as always, profile (or, apple might say, instrument) before optimise!


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -