-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Leak with AdMob #53
Comments
Hmm, Yeah, the Google control does cause issues with it's use. We'll see if there is anything further we can do to manage it . |
I have dug into this memory leak and made some code changes on my fork. I could not solve the admob memory leak, but i did for 2 other control, plus the adrotator as a whole. In short, some ad provider controls do not turn off their timer on the unload. This leave a reference to them and they are never garbage collected. They need to be stopped using their stopad method. I added support to auto trigger these when the add changes. This stop all the extra calls it keeps making and lets it be GCed. I solved this for Smaato and Vserv (a new ad provider i just added to my version). I could not find any method to tell the admob control to stop its timer. In my case, i have the adrotaor on a few page, so the adrotaor as a whole keeps ticking away even when i have unloaded the page. It cant be GCed. I also added support for that memory leak. I tend to call these timer leaks. Only solution i can think of for the admob control is to create an instance of the control and then keep that one around in memory. Sounds messy, Id like to see the WebApi solution for admob. I'm very new to Git, so when i figure out how to request a merge when i done testing ill try to add it to the project. Changes • Add provider Vserv for wp8.0/wp8.1 |
That is fantastic and awesome news @jamesfdickinson You can submit a PR in one of two ways, either:
Any issues, please let me know. |
RIght @jamesfdickinson , Managed to find some spare time and look through your changes this weekend. TO save you time, I'll pull them and incorporate them from your repo this time. |
OK, pulled out the updates and moved them to a new fork on my repo Still a bit of work to do as my main machine only has 2015 now, need to use another PC for 2012/2013 verification. |
Not sure you got the last 2 i did last night. That should be all the changes. I don't plan on updating anything else soon. I was developing in VS 2012, so the 2013/2015 project file may not have a reference to the new code file for Vserv. As for testing, I have been doing my own dev testing by displaying the logs in my app in debug mode. I'm also pushing my build to one of my lesser used apps for production verification(1000 daily active users). ill watch the error logs in my analytic, then if no issues, use the new build in my high traffic app (30,000 daily uses). Smaato(wp8.0) seems to not load ads sometime without error so it does not move to the next. From my testing, it seem as if it is getting ads, but sometimes it is getting it in rich media format not image and does not display. Seems to be an issue with Smaato's control. I get the same behavior with their wp8 demo code. AdRetrievalMode in the config is a new feature, so not sure that is out side of the scope without discussing the change first. BTW, it looked like AdMode.Stepped does nothing, it may but i didn't see any code next to it in the switch case. I didn't test or look further. • Bug fix: Event Handler leak adRotatorControl.AdAvailable onload. If the page the control is on is navigated back to, the on load is called again and it will create a 2nd delegate for the event handler for each page load. This caused the ad to be created multiple times. https://github.com/jamesfdickinson/AdrotatorV2/commits/develop |
Great work @jamesfdickinson As to AdMode.Stepped doing nothing. Basically Both of those cases use the same Switch block, if it's ordered, then it breaks out early with the current top most successful Ad. Ordered basically means my most preferred Ad will show until it fails, then fall back to second favourite. Right, I'll commit these changes in to the base, just won't make a new build yet as a few other things need to be added. If you then want to a Git Pull from The source (upstream) repo, it should get you back in sync. Then when you start work on another feature / fix, just create a new branch, put your changes in that and submit a PR from GitHub (the article I mentioned should help). P.S. If you want to drop me a mail (through the contact page on my blog http://darkgenesis.zenithmoon.com), I'd like to talk further 💃 P.S. |
Done @jamesfdickinson |
@jamesfdickinson thank you for your great work! There are only two of them: Good luck! |
I found this issue with Google Admob Banner: I created an user control contain AdRotator , and enable only Admob and Pubcenter with Probability = 50/50. I added it to a single page and repeatly refresh that page . Each time the Admob loaded, memory rose for 10-15MB and app crashed after 15 + times refresh page.
This seem like google's problem since I tackled this problem with my previous app using AdMob.
The text was updated successfully, but these errors were encountered: