mwaterfall / MWPhotoBrowser

A simple iOS photo and video browser with grid view, captions and selections.
MIT License
8.75k stars 2.71k forks source link

MWPhotoBrowser memory leak #446

Open dbzu opened 8 years ago

dbzu commented 8 years ago

i'm using MWPhotoBrowser as my photo browser in my app. every time I select a picture in my collection view, and the browser opens, it's adding 20Mb of memory usage, and when i'm browsing between the pictures it's adding memory until I get something like 600Mb of memory usage, and when I pop the view controller the memory usage stays the same.

this is how I load the images:

photosForImageViewer = [NSMutableArray array]; for (int i = 0; i<[photosShownInLibrary count]; i++) { [photosForImageViewer addObject:[MWPhoto photoWithImage:[[photosShownInLibrary objectAtIndex:i] getUIImage]]]; } getUIImage is a method in my custom class that simply turn nsdata to uiimage and return the uiimage.

when I checked the memory usage in the xcode instruments, it seems like the problem isn't in my code, but in the core foundation (Probably something wrong with the MWPhotoBrowser class)

this is what collects the memory according to xcode instruments:

_CFRunLoopRun (CoreFoundation) ImageIO_Malloc (imageIO) mmap$UNIX2003 (libsystem_kernel.dylib) any idea how I can fix it? or what is the problem??

pawelnathan commented 8 years ago

I am having similiar memory issues. Has anybody found a solution so far?