override func viewDidLoad() {
super.viewDidLoad()
configureGoogleAdBanner()
}
func configureGoogleAdBanner() {
self.adBannerView.delegate = self
self.adBannerView.isHidden = true
self.adBannerView.adUnitID = HOME_ADUNIT_ID
self.adBannerView.rootViewController = self
let gadRequest = GADRequest()
adBannerView.load(gadRequest)
}
func adViewDidReceiveAd(_ bannerView: GADBannerView!) {
self.adBannerView.isHidden = false
}
Here is my POD file
# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'Taboo' do
pod 'Alamofire', '~> 4.0'
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
How can i release the memory used by the ads? I have tried a lot of options but nothing worked.
Please help me out. I cannot move forward with this issue.
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/clcME6vdhWQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Veer,Can you please send me an email to which i can respond with the code?
Thanks for your help.
Regards,Shravan
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
Hi Shravan,
I have not found anything wrong with your implementation. Here is my analysis on this -
- Transient memory:
- The first thing to understand is that the memory being taken up is all Transient memory. Meaning that it would be flushed out by the system if the device is in need of it. What you need to be worried about is Persistent memory.
- The AdView is being held in reference because the system understands that the user can at anytime go back from B-ViewController to A-ViewController and so on.
- One way to manage this is by removing the AdView from the UIView when a new VC is being presented.
- RootVC:
- One ideal way would be to have a RootViewController, such as a UINavigationController, and have one reference to the Banner AdView and place it in the rootVC.
- This way, you can have as many VC's being presented by the rootVC but will still have one reference to the BannerView.
- Cause of your crash:
- I still believe that the root cause for your app's crash might be something else.
- It would be interesting if you can memory profile using Instruments as linked earlier to see whether the references at the time of the crash are pointing to our SDK or to your own apps.
Thanks,Arjun BusaniMobile Ads SDK Team
On Thursday, November 3, 2016 at 2:56:14 PM UTC-4, Shravan Kumar Singireddy wrote:
Hello Veer,Can you please send me an email to which i can respond with the code?
Thanks for your help.
Regards,Shravan
To post to this group, send email to google-adm...@googlegroups.com.
1. Did you see the memory usage go high when you go back and forth between controllers with ads ON? This is just for me to know that i am reading it right
2. Did you see the memory usage stay constant when you go back and forth between controllers with ads OFF? This is also just for me to know that i am reading it right
3. Were you able to crash the minified app that i provided? It will definitely crash if i keep going back and forth
5. I can try this option you provided "One way to manage this is by removing the AdView from the UIView when a new VC is being presented." But, this would just help me save Transient memory and not persistent one right?