Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-22-2008, 08:01 PM   #1 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 1
Default Memory issues when displaying images

Hi all,

I'm trying to run an animation by changing the images of my UIImageView at a 20 fps rate. I need about 100 images of 24K to create a 5 sec animation. I am able to load all the images into the memory (into an NSArray), but when I start the animation (switching the UIImage of the UIImageView) - after about 60 images I get a memory warning and if I continue displaying images the app crashes.

I have tried several ways to load the images - first was imageNamed which turned out to cache all images into the memory hence couldn't load more than about 40 images, and after that tried using initWithContentsOfFile (which doesn't cache the images) which helped in loading all the images to the memory, but still when i animated them it caused memory problems and eventually a crash.

I think I'm doing something wrong... these are the main areas I'm not sure about:
1. how come displaying an image (24K) that was already loaded into memory (and not cached) takes about 200ms? What's the fastest way to display an already loaded image?
2. Is there some kind of a display memory that is different from the RAM (like on a graphic card or something) that can be cleared on demand/increased?
3. Any general suggestions as for how to run the animation better?

I'm really lost here so any help would be appreciated, Thanks
LibraF is offline   Reply With Quote
Old 08-16-2009, 12:06 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 66
Default

Quote:
Originally Posted by LibraF View Post
Hi all,

I'm trying to run an animation by changing the images of my UIImageView at a 20 fps rate. I need about 100 images of 24K to create a 5 sec animation. I am able to load all the images into the memory (into an NSArray), but when I start the animation (switching the UIImage of the UIImageView) - after about 60 images I get a memory warning and if I continue displaying images the app crashes.

I have tried several ways to load the images - first was imageNamed which turned out to cache all images into the memory hence couldn't load more than about 40 images, and after that tried using initWithContentsOfFile (which doesn't cache the images) which helped in loading all the images to the memory, but still when i animated them it caused memory problems and eventually a crash.

I think I'm doing something wrong... these are the main areas I'm not sure about:
1. how come displaying an image (24K) that was already loaded into memory (and not cached) takes about 200ms? What's the fastest way to display an already loaded image?
2. Is there some kind of a display memory that is different from the RAM (like on a graphic card or something) that can be cleared on demand/increased?
3. Any general suggestions as for how to run the animation better?

I'm really lost here so any help would be appreciated, Thanks
memory problems imageNamed
you can send me code [initWithContentsOfFile]

pliss i have 30 images
SR79 is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, memory, uiimage, uiimageview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 245
17 members and 228 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:43 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0