title: AFNetworking memory allocation keeps rising
body: <p>I'm making an app which will fetch pictures resources and text from web service. I pick the great AFNetworking's UIImageView+AFNetworking category to deal with the image downloading stuff.</p>
  
  <p>However, I'm facing a memory problem. I used <strong>Allocation</strong> tool of the <strong>Instruments</strong>, finding each time I load more images, there will always be a growth of memory allocation, 1-2 MB in size. I tracked down to the source code, it turned out that it lies in AFNetworking's code.</p>
  
  <p>The exact line of code is:</p>
  
  <pre><code>- (void)connectionDidFinishLoading:(NSURLConnection *)__unused connection {
      self.responseData = [self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey];
  
      [self.outputStream close];
  
      [self finish];
  
      self.connection = nil;
  }
  </code></pre>
  
  <p>This will occupy 99.6% of the memory allocation.</p>
  
  <p>I user ARC in the project, display the UIImageViews in a UITableView and configure the cell like the following code:</p>
  
  <pre><code>[self.imageView setImageWithURLRequest:request
                            placeholderImage:nil
                                     success:successBlock
                                     failure:failBlock];
  </code></pre>
  
  <p>Can any one offer some idea about the memory issue? It's really a headache cuz once the memory is allocated, they will never be cleared even if I cleared the whole image view. After a little while, my app will occupy more than 100MB from the <strong>Real Memory Usage</strong> window of <strong>Instruments</strong>.</p>
  
  <p>Any help will be greatly appreciated!! Thanks in advance!!</p>