title: Flurry Analytics - NSAutoreleasePool allocWithZone:] - memory leak after upgrading to Objective-C ARC
body: <p>I just recently upgraded my project to iOS 5 with ARC (automatic reference counting) and now Instruments is reporting a memory leak from NSAutoreleasePool after I suspend the app in the background.</p>
  
  <p>I suspect the leak is being caused by Flurry Analytics based on the stack trace with these two API calls:</p>
  
  <pre><code>+[FlurrySession sendSessionsToServerForSessionPause]
  +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAppCircleAds:requestVideoAds:requestAppSpotAds:sendCurrentSession:]
  </code></pre>
  
  <p>I'm not making any Flurry API calls on suspend. The only call being made to flurry is</p>
  
  <pre><code>[FlurryAnalytics startSession:&lt;my id&gt;];
  </code></pre>
  
  <p>when the app first starts.</p>
  
  <p><strong>Reported leak</strong></p>
  
  <pre><code>Leaked Object   #       Address     Size        Responsible     Library Responsible Frame
  
  NSAutoreleasePool,1     0x7693f600  32 Bytes    Foundation      +[NSAutoreleasePool allocWithZone:]
  </code></pre>
  
  <p><strong>Stack trace</strong></p>
  
  <pre><code>  10 libsystem_c.dylib thread_start
     9 libsystem_c.dylib _pthread_start
     8 Foundation __NSThread__main__
     7 Foundation -[NSThread main]
     6 iSURVEY +[FlurrySession sendSessionsToServerForSessionPause] /Developer/Applications/iPhoneAdAgent_modular/Classes/FlurrySession.m:931
     5 iSURVEY +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAppCircleAds:requestVideoAds:requestAppSpotAds:sendCurrentSession:] /Developer/Applications/iPhoneAdAgent_modular/Classes/FlurrySession.m:962
     4 CoreFoundation +[NSObject(NSObject) alloc]
     3 Foundation +[NSAutoreleasePool allocWithZone:]
     2 CoreFoundation +[NSObject(NSObject) allocWithZone:]
     1 libobjc.A.dylib class_createInstance
     0 libsystem_c.dylib calloc
  </code></pre>
  
  <h3>Edit:</h3>
  
  <p>I just tried turning off all debug variables like zombies and the memory leak is still exactly the same.</p>
  
  <h3>Edit 2:</h3>
  
  <p>Okay I've confirmed that it definitely is a Flurry issue. After removing the call</p>
  
  <pre><code>[FlurryAnalytics startSession:&lt;my id&gt;];
  </code></pre>
  
  <p>I no longer get the memory leak.</p>
  
  <p>I'll file a bug with the Flurry team.</p>