Re: memory allocation different in simulator and on the iPhone

2009-07-28 Thread Sven
UIImage* image = [UIImage imageNamed:fileName]; Loading an image with imageNamed causes the image to be cached in memory as per the documentation. I suggest using one of the alternatives to load your images and see how that affects memory usage ./Sven 2009/7/24 Dragos Ionel > You are right, I

Re: memory allocation different in simulator and on the iPhone [solved]

2009-07-24 Thread Dragos Ionel
Dear all, Thank you all for the feedback. With that help and few hours of digging I was able to solve the problem. Just for reference here is what I was doing wrong; 1. UIImage* image = [UIImage imageNamed:fileName]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; *[image *

Re: memory allocation different in simulator and on the iPhone

2009-07-24 Thread Jesse Armand
Try to use image allocation methods besides imageNamed Jesse Armand (http://jessearmand.com) On Fri, Jul 24, 2009 at 9:07 AM, Dragos Ionel wrote: > Hi, > I am working on a animal encyclopedia on iPhone. One of the pages displays > one photo of an animal.

Re: memory allocation different in simulator and on the iPhone

2009-07-24 Thread Jonathan del Strother
I believe +[UIImage imageNamed] caches the image, so you would see memory increasing. I'm guessing that you eventually triggered a memory warning, so UIImage dropped its caches, resulting in the crash due to your over-release. On Fri, Jul 24, 2009 at 1:04 PM, Dragos Ionel wrote: > You are right,

Re: memory allocation different in simulator and on the iPhone

2009-07-24 Thread Dragos Ionel
You are right, I was over releasing and maybe that was crashing the app. But still, even without [image release] the memory used by the app on iPhone is slowly increasing (like 3K for each image display). Maybe that is supposed to happen , maybe something is cached somewhere. But the good thing is

Re: memory allocation different in simulator and on the iPhone

2009-07-24 Thread Jonathan del Strother
UIImage* image = [UIImage imageNamed:fileName]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [image release]; You're overreleasing the image there. You sure the phone is dying because it's out of memory, rather than because of that? On Fri, Jul 24, 2009 at 3:07 AM, Dragos

memory allocation different in simulator and on the iPhone

2009-07-23 Thread Dragos Ionel
Hi, I am working on a animal encyclopedia on iPhone. One of the pages displays one photo of an animal. When the user swipes the screen the image is replaced with another one. This works fine and when tested in the simulator with the Instrument for Object Allocation, all looks cool. When I tested