enormego / PhotoViewer

Quick PhotoViewer for the iPhone. Built upon our other reliable libraries: EGOImageLoading and EGOCache.
http://developers.enormego.com
659 stars 140 forks source link

App crash #6

Open patriksharma opened 14 years ago

patriksharma commented 14 years ago

As i integrated Photo viewer in my app. it is working fine in simulator But when we check it on Iphone device(3G) the app gets crash while uploading the pictures . As i found (In Instruments) the object allocation increases while uploading the pictures in the Photo Viewer . Object allocation go beyond the 23.5 MB. As i checked while debugging the application , when we click on the picture the object allocation increases from (currently) 5 MB to 15 MB(after clicking on the picture). So i think just because of object allocation app gets crash .

Garfinkle commented 14 years ago

I'm having the same issue on the iPad. I'm loading 23 photos at 1024x768 and when scrolling through a level 1 memory warning I thrown. When I check in instruments each image is allocating approx 2-3 mb and at about 24mb the memory warning is thrown. The analyser doesn't show any potential leaks. It appear that the images are being released but not quick enough so too many get stored in memory.

Any one know how to improve this so images are unloaded an released the moment you move away? In therory only 3 images need to be retained, the one you ate looking at and one eitherside.

Any help would be great for this issue

patriksharma commented 14 years ago
patriksharma commented 14 years ago

Hii the above posted function is of photoviewcontroller.m class.

Somehow iam able to fix it . i called Egocache.m class everytime to clear the last uploaded image in the photoviewer . So that there are less chance of crash

You try this function may be this helpful to you and let me know :-)

Garfinkle commented 14 years ago

Hi Patriksharma.

The magic line in the code you posted is

EGOCache *cache = [[EGOCache alloc] init]; [cache clearCache]; [cache release]; Thank you very much :D
Garfinkle commented 14 years ago

The issue seems to have re appeared, not sure what is causing it

patriksharma commented 14 years ago

it is working fine with Iphone 4G but it is crashing in Iphone 3GS and IOA 3.1.3