Hi AdMob developers,I'm using AdMob SDK (I tried both 6.3.0 and 6.4.0) and Mediation to integrate AdMob and iAd ads (only banner) into my iOS app. Code is written in Xcode 4.6 with ARC. The app is run on iPad with iOS 5.0.1 and I check the memory leak with the build-in tool "instruments" in Xcode 4.6. Finally I found periodical (not exactly same time interval) memory leaks which I believe is caused by AdMob SDK.The code is simple. I just follow the AdMob document.In ViewController.h@interface ViewController2 : UIViewController <UIAlertViewDelegate, GADBannerViewDelegate>{...// Declare one as an instance variableGADBannerView *bannerView_;}In ViewController.m- (void)viewDidLoad{...[self onEnter];}- (void)onEnter{if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) {bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];// MediationbannerView_.adUnitID = @"my mediation ID1";} else {bannerView_ = [[GADBannerView alloc]initWithAdSize:kGADAdSizeSmartBannerPortrait];// MediationbannerView_.adUnitID = @"my mediation ID2";}[bannerView_ setDelegate:self];bannerView_.rootViewController = self;// Reposition banner viewbannerView_.frame = CGRectMake((self.view.bounds.size.width - bannerView_.bounds.size.width) / 2.0,0,bannerView_.bounds.size.width,bannerView_.bounds.size.height);// Add banner view into hierarchy[self.view addSubview:bannerView_];// Initiate a generic request to load it with an ad.GADRequest *request = [GADRequest request];[bannerView_ loadRequest:request];}The code goes well with ads loading and there is no crash. However there is memory leak.Based on my statistics, leakage normally happens every about one minute, sometimes every about 30 seconds and the size for each time is 1.5K. The ads refresh time interval is 30 seconds.Output of instruments:Leaked Object # Address Size Responsible Library Responsible FrameNSConcreteData 4 < multiple > 6.00 KB Foundation -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]NSConcreteData 1 0xe873a00 1.50 KB Foundation -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]NSConcreteData 1 0xf0be800 1.50 KB Foundation -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]NSConcreteData 1 0xe87c000 1.50 KB Foundation -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]NSConcreteData 1 0xe88e000 1.50 KB Foundation -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]If I click into one of the NSConcreteData, the output is# Address Category Event Type RefCt Timestamp Size Responsible Library Responsible Caller0 0xe873a00 Malloc 2.00 KB Malloc 1 00:24.830.465 2048 GLEngine gleCreateTextureObject1 0xe873a00 Malloc 2.00 KB Free 0 00:24.832.580 -2048 GLEngine gleFreeTextureState2 0xe873a00 NSConcreteData Malloc 1 00:25.928.426 1536 Foundation -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]3 0xe873a00 NSConcreteData Retain 2 00:25.928.477 0 CFNetwork __CFCachedURLResponse::__CFCachedURLResponse(_CFURLResponse*, __CFData const*, void const*, CFURLCacheStoragePolicy)4 0xe873a00 NSConcreteData Retain 3 00:25.928.498 0 CFNetwork __CFCachedURLResponse::__CFCachedURLResponse(_CFURLResponse*, __CFData const*, void const*, CFURLCacheStoragePolicy)5 0xe873a00 NSConcreteData Retain 4 00:56.264.641 0 Foundation -[NSCachedURLResponse data]6 0xe873a00 NSConcreteData Release 3 01:26.562.575 0 CFNetwork __CFCachedURLResponse::~__CFCachedURLResponse()7 0xe873a00 NSConcreteData Release 2 01:26.562.581 0 CFNetwork __CFCachedURLResponse::~__CFCachedURLResponse()8 0xe873a00 NSConcreteData Release 1 01:26.563.126 0 Foundation -[NSCachedURLResponseInternal dealloc]Different NSConcreteData will have different content but the last 7 lines (from 2-8 in this case ) normally are very similar. We can see that one object is leaked because the short of one more Release and the reference count can not go down to 0.If I comment out the last two lines in onEnter() method (request definition and loadRequest message), there is no ad loaded and there is no memory leak.Following is the call tree of the leaked memory. Hope it is helpful to locate the leakage.Bytes Used # Leaks Symbol Name6.00 KB 100.0% 4 start6.00 KB 100.0% 4 main6.00 KB 100.0% 4 UIApplicationMain6.00 KB 100.0% 4 GSEventRunModal6.00 KB 100.0% 4 CFRunLoopRunInMode6.00 KB 100.0% 4 CFRunLoopRunSpecific6.00 KB 100.0% 4 __CFRunLoopRun6.00 KB 100.0% 4 __CFRunLoopDoSources06.00 KB 100.0% 4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__6.00 KB 100.0% 4 MultiplexerSource::perform()6.00 KB 100.0% 4 URLConnectionClient::processEvents()6.00 KB 100.0% 4 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long)6.00 KB 100.0% 4 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*)6.00 KB 100.0% 4 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:]6.00 KB 100.0% 4 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]6.00 KB 100.0% 4 -[NSURLConnectionInternalConnection invokeForDelegate:]6.00 KB 100.0% 4 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_06.00 KB 100.0% 4 -[GADURLConnection connectionDidFinishLoading:]6.00 KB 100.0% 4 -[GADURLConnection tryToStoreResponseAndData]6.00 KB 100.0% 4 -[NSCachedURLResponse initWithResponse:data:]6.00 KB 100.0% 4 -[NSCachedURLResponse initWithResponse:data:userInfo:storagePolicy:]6.00 KB 100.0% 4 -[NSData(NSData) initWithData:]6.00 KB 100.0% 4 -[NSConcreteData initWithBytes:length:copy:freeWhenDone:bytesAreVM:]6.00 KB 100.0% 4 NSAllocateObject6.00 KB 100.0% 4 class_createInstance6.00 KB 100.0% 4 callocIf I made anything wrong, please tell me and I will fix it. If it is a bug, I hope it could be fixed as soon as possible.Best regards,Lei Zhang--
---
You received this message because you are subscribed to the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Raj,Here is what I did:1. Use Xcode (4.6.1) to create an single view project.2. Add following platforms.iAd.framework, AdSupport.framework(optional), SystemConfiguration.framework, MessageUI.framework, AudioToolbox.framework, StoreKit.framework. Set Other linker flags to -ObjC.3. Add AdMob SKD (see project).4. Add iAdAdapter (see project).5. Add code into ViewController.h and ViewController.m.6. Because I want the app to run on iOS 5, I change the Deployment Target from 6.1 to 5.0 in PROJECT and TARGETS settings.Run the app and ads are loaded correctly.Load the app onto an iPad, in my case the OS is iOS 5.0.1.Run the Xcode build-in tool Instruments, choose the target and activate record. Normally it will begin to leak in 1 or 2 minutes.By the way, I also realize that even I didn't not add iAd into the project (iAd adapter and iAd.framework) and AdMob mediation center, the leak is still there.Best regards,Lei