Low memory warning with several EGOImageView

EGOImageView can lead to memory leaks, be aware.

First of all, check if it releases _responseData in EGOImageLoadConnection's dealloc so that it looks like:

- (void)dealloc
{
    self.response = nil;
    self.delegate = nil;
    [_connection release];
    [_imageURL release];
    [_responseData release];  //this line is absent in current EGOImageLoadConnection.m

    [super dealloc];
}

Then call cancelImageLoad when deallocating a view which uses it and nil its image attribute (remember, I use ARC code sample):
- (void)dealloc
 {
    //...
    self.myView.image = nil;
    [self.myView cancelImageLoad];
    //...
 }

And I'd also recommend to call sometimes:
[EGOCache.currentCache clearCache];

Anyway, feel free to use Instruments. Open Allocations instrument, click VM Tracker and set automatic snapshots to 1 sec delay. Then watch Dirty memory column and Memory Tag 70 line, which shows how much memory images consume in your application.


转帖:http://stackoverflow.com/questions/11437497/low-memory-warning-with-several-egoimageview

你可能感兴趣的:(Low memory warning with several EGOImageView)