samsoffes/sstoolkit — Issue #96: SSCollectionView has memory issues when loading large amounts of data
Author: nnhubbard
Created: 2011-10-20 18:40:54+00:00
State: open

Using your SSCatalog example I had the SSCollectionView load some larger images. This makes the memory usage quite high. When you then pop the viewController back to the root you would expect all of that memory to be freed up, but it doesn't seem to be. Doing this a with a large amount of images or viewControllers being pushed will cause memory warnings and crashes.

Added in SSCollectionViewDemoViewController.m in itemForIndexPath:

```objective-c
NSArray *items = [NSArray arrayWithObjects:
@"http://www.puc.edu/__data/assets/image/0006/33279/_MG_2948.jpg",
@"http://www.puc.edu/__data/assets/image/0016/33280/_MG_2951.jpg",
@"http://www.puc.edu/__data/assets/image/0017/33281/_MG_2978.jpg",
@"http://www.puc.edu/__data/assets/image/0018/33282/_MG_2988.jpg",
@"http://www.puc.edu/__data/assets/image/0019/33283/_MG_2995.jpg",
@"http://www.puc.edu/__data/assets/image/0020/33284/_MG_3015.jpg",
@"http://www.puc.edu/__data/assets/image/0003/33285/_MG_3044.jpg",
@"http://www.puc.edu/__data/assets/image/0004/33286/_MG_3058.jpg",
@"http://www.puc.edu/__data/assets/image/0005/33287/_MG_3067.jpg",
@"http://www.puc.edu/__data/assets/image/0006/33288/_MG_3076.jpg",
@"http://www.puc.edu/__data/assets/image/0007/33289/_MG_3085.jpg",
@"http://www.puc.edu/__data/assets/image/0017/33290/_MG_3094.jpg",
@"http://www.puc.edu/__data/assets/image/0011/34859/_MG_3682.jpg",
@"http://www.puc.edu/__data/assets/image/0003/34860/_MG_3688.jpg",
@"http://www.puc.edu/__data/assets/image/0004/34861/_MG_3691.jpg",
@"http://www.puc.edu/__data/assets/image/0005/34862/_MG_3717.jpg",
@"http://www.puc.edu/__data/assets/image/0006/34863/_MG_3727.jpg",
@"http://www.puc.edu/__data/assets/image/0007/34864/_MG_3747.jpg",
@"http://www.puc.edu/__data/assets/image/0008/34865/_MG_3773.jpg",
@"http://www.puc.edu/__data/assets/image/0009/34866/_MG_3795.jpg",
@"http://www.puc.edu/__data/assets/image/0010/34867/_MG_3803.jpg",
@"http://www.puc.edu/__data/assets/image/0011/34868/_MG_3822.jpg",
@"http://www.puc.edu/__data/assets/image/0003/34869/_MG_3830.jpg",
@"http://www.puc.edu/__data/assets/image/0004/34870/_MG_3839.jpg",
@"http://www.puc.edu/__data/assets/image/0005/34871/_MG_3845.jpg",
@"http://www.puc.edu/__data/assets/image/0006/34872/_MG_3847.jpg",
@"http://www.puc.edu/__data/assets/image/0007/34873/_MG_3861.jpg",
@"http://www.puc.edu/__data/assets/image/0008/34874/_MG_3870.jpg",
@"http://www.puc.edu/__data/assets/image/0009/34875/_MG_3881.jpg",
@"http://www.puc.edu/__data/assets/image/0019/35335/IMG_0010.jpg",
@"http://www.puc.edu/__data/assets/image/0020/35336/IMG_0034.jpg",
@"http://www.puc.edu/__data/assets/image/0003/35337/IMG_0060.jpg",
@"http://www.puc.edu/__data/assets/image/0004/35338/IMG_0067.jpg",
@"http://www.puc.edu/__data/assets/image/0005/35339/IMG_8080.jpg",
@"http://www.puc.edu/__data/assets/image/0015/35340/IMG_8082.jpg",
@"http://www.puc.edu/__data/assets/image/0016/35341/IMG_8083.jpg",
@"http://www.puc.edu/__data/assets/image/0017/35342/IMG_8129.jpg",
@"http://www.puc.edu/__data/assets/image/0018/35343/IMG_8171.jpg",
@"http://www.puc.edu/__data/assets/image/0019/35344/IMG_8283.jpg",
@"http://www.puc.edu/__data/assets/image/0020/35345/IMG_8329.jpg",
@"http://www.puc.edu/__data/assets/image/0003/35346/IMG_8332.jpg",
@"http://www.puc.edu/__data/assets/image/0004/35347/IMG_8398.jpg",
@"http://www.puc.edu/__data/assets/image/0005/35348/IMG_8405.jpg",
@"http://www.puc.edu/__data/assets/image/0006/35349/IMG_8408.jpg",
@"http://www.puc.edu/__data/assets/image/0016/35350/IMG_8439.jpg",
@"http://www.puc.edu/__data/assets/image/0017/35351/IMG_8441.jpg",
@"http://www.puc.edu/__data/assets/image/0018/35352/IMG_8466.jpg",
@"http://www.puc.edu/__data/assets/image/0019/35353/IMG_8482.jpg",
@"http://www.puc.edu/__data/assets/image/0020/35354/IMG_8540.jpg",
@"http://www.puc.edu/__data/assets/image/0003/35355/IMG_8721.jpg",
@"http://www.puc.edu/__data/assets/image/0004/35356/IMG_8815.jpg",
@"http://www.puc.edu/__data/assets/image/0005/35357/IMG_8824.jpg",
@"http://www.puc.edu/__data/assets/image/0006/35358/IMG_9100.jpg",
@"http://www.puc.edu/__data/assets/image/0007/35359/IMG_9723.jpg",
@"http://www.puc.edu/__data/assets/image/0017/35360/IMG_9730.jpg",
@"http://www.puc.edu/__data/assets/image/0018/35361/IMG_9754.jpg",
@"http://www.puc.edu/__data/assets/image/0019/35362/IMG_9778.jpg",
@"http://www.puc.edu/__data/assets/image/0020/35363/IMG_9803.jpg",
@"http://www.puc.edu/__data/assets/image/0003/35364/IMG_9877.jpg",
@"http://www.puc.edu/__data/assets/image/0005/35366/DSC_0007.jpg",
@"http://www.puc.edu/__data/assets/image/0006/35367/DSC_0049.jpg",
@"http://www.puc.edu/__data/assets/image/0007/35368/DSC_0056.jpg",
@"http://www.puc.edu/__data/assets/image/0008/35369/DSC_0057.jpg",
@"http://www.puc.edu/__data/assets/image/0018/35370/DSC_0080.jpg",
@"http://www.puc.edu/__data/assets/image/0019/35371/DSC_0101.jpg",
@"http://www.puc.edu/__data/assets/image/0020/35372/DSC_0105.jpg",
@"http://www.puc.edu/__data/assets/image/0003/35373/DSC_0127.jpg",
@"http://www.puc.edu/__data/assets/image/0004/35374/DSC_0144.jpg",
@"http://www.puc.edu/__data/assets/image/0005/35375/DSC_0146.jpg",
@"http://www.puc.edu/__data/assets/image/0006/35376/DSC_0186.jpg",
@"http://www.puc.edu/__data/assets/image/0007/35377/Jeff_and_Parents.jpg",
@"http://www.puc.edu/__data/assets/image/0008/35378/Ryan_and_Family.jpg",
@"http://www.puc.edu/__data/assets/image/0009/35379/The-Ackerman-Family-1.jpg",
@"http://www.puc.edu/__data/assets/image/0019/35380/The-Dunn-Family-5.jpg",
@"http://www.puc.edu/__data/assets/image/0020/35381/The-Vo-Family.jpg",
@"http://www.puc.edu/__data/assets/image/0003/35382/The-Wood-Family.jpg",
@"http://www.puc.edu/__data/assets/image/0008/36188/_MG_6018.jpg",
@"http://www.puc.edu/__data/assets/image/0009/36189/_MG_6030.jpg",
@"http://www.puc.edu/__data/assets/image/0019/36190/_MG_6042.jpg",
@"http://www.puc.edu/__data/assets/image/0020/36191/_MG_6067.jpg",
@"http://www.puc.edu/__data/assets/image/0003/36192/_MG_6081.jpg",
@"http://www.puc.edu/__data/assets/image/0004/36193/_MG_6083.jpg",
@"http://www.puc.edu/__data/assets/image/0005/36194/_MG_6086.jpg",
@"http://www.puc.edu/__data/assets/image/0006/36195/_MG_6098.jpg",
@"http://www.puc.edu/__data/assets/image/0007/36196/_MG_6101.jpg",
@"http://www.puc.edu/__data/assets/image/0008/36197/_MG_6142.jpg",
@"http://www.puc.edu/__data/assets/image/0009/36198/_MG_6146.jpg",
@"http://www.puc.edu/__data/assets/image/0010/36199/_MG_6155.jpg",
@"http://www.puc.edu/__data/assets/image/0011/36200/_MG_6158.jpg",
@"http://www.puc.edu/__data/assets/image/0012/36201/_MG_6160.jpg",
@"http://www.puc.edu/__data/assets/image/0013/36202/_MG_6164.jpg",
@"http://www.puc.edu/__data/assets/image/0014/36203/_MG_6168.jpg",
@"http://www.puc.edu/__data/assets/image/0015/36204/_MG_6170.jpg",
@"http://www.puc.edu/__data/assets/image/0016/36205/_MG_6171.jpg",
@"http://www.puc.edu/__data/assets/image/0017/36206/_MG_6172.jpg",
@"http://www.puc.edu/__data/assets/image/0018/36207/_MG_6173.jpg",
@"http://www.puc.edu/__data/assets/image/0019/36208/_MG_6175.jpg",
@"http://www.puc.edu/__data/assets/image/0020/36209/_MG_6182.jpg",
@"http://www.puc.edu/__data/assets/image/0012/36210/_MG_6195.jpg",
@"http://www.puc.edu/__data/assets/image/0013/36211/_MG_6199.jpg",
nil];

item.imageURL = [NSURL URLWithString:[items objectAtIndex:indexPath.row]];
```