gdavis / FGallery-iPhone

Objective-C based gallery for iPhones
583 stars 144 forks source link

Memory warnings & crashes #13

Closed r3econ closed 1 year ago

r3econ commented 12 years ago

So, I loaded 180 images (about 500Kb each). And after I viewed about 15 app crashed (: Memory level is not normal (63%).).

I guess the memory handling is not done in a right way.

gdavis commented 12 years ago

Are you loading the images into memory before FGallery requests them?

gdavis commented 12 years ago

And are you loading from the network or disk?

ghost commented 12 years ago

I experienced the same issue by loading multiple images from the web. just added additional image URLs to the networkImages NSArray in your example. Memory Usage is growing fast and then the App crashes Is there another way to handle a high amount of pictures loaded from the web?

ernani commented 12 years ago

I am having the exact same issue, I am testing within an iPhone 3Gs with iOS 5.1.1.

It seems it doesn't like much about the preloading threads, after some usage, it crashes and the available memory gets knocked out.

UPDATED: If using this component on a UINavigationController, I was able to manage the memory by handling the cleanup of images and threads on viewDidDisappear, this way my memory keeps fresh on each viewWillAppear.

ghost commented 11 years ago

How did you do that? Are you using the code from the memory warning method? thanks

ernani commented 11 years ago

I don't have the access to the code for now but will keep your notificaiton here on my email and will update the message later with the details on my code, sounds good?

Cheers

On Fri, Jan 4, 2013 at 8:29 AM, acaserop notifications@github.com wrote:

How do you did that? Are you using the code from the memory warning method? thanks

— Reply to this email directly or view it on GitHubhttps://github.com/gdavis/FGallery-iPhone/issues/13#issuecomment-11878964.

ghw311 commented 11 years ago

Application crashes on loading too many images in iPhone,why?

ernani commented 11 years ago

It depends on the size of the images and also the amount of images you are displaying in a grid, also I'd recommend optimizing the methods I've suggested up above.