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:
(id )photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index {
if (index < photosForImageViewer.count) {
return [photosForImageViewer objectAtIndex:index];
}
return nil;}
photosForImageViewer is an nsmutablearray that implemented like this:
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??
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??