Huge memory leak?

May 22, 2013 at 3:28 PM
This is the case, my app crashes after a certain amount of time. Idling on a static screen with the adrotator even causes the crash. I implemented this class:
http://blogs.msdn.com/b/ptorr/archive/2010/10/30/that-memory-thing-i-promised-you.aspx

At start of app, used memory is +- 30 mb. After +- 5 minutes idling, used memory is 120mb (!). 90mb is normally the maximum, so that is a huge leak.
If I hide the ad control, memory stays at 30mb...

Running memory profiler tells me that 200k strings are loaded in memory, I have to analyze the rest of it. But, the problem IS the adrotator, because without it, I have no memory issue.
I have this settings:

SlidingAdDirection="Left"
                                SlidingAdDisplaySeconds="10"
                                SlidingAdHiddenSeconds="0"
Removing those settings solves the problem too...
Coordinator
May 22, 2013 at 6:01 PM
Ok, huge apologies if that's the case, in none of our testing or the apps using it has a memory problem surfaced.

Can you replicate the issue using your method in the example add using your configuration?

I'll do some checking this side but we only use a single timer and 3 events in the silverlight version for the sliding, even less in the XNA version, so it shouldn't cause any memory leak unless the increase in AdRequests is causing some of the providers to throw a wobly.

BTW
Which version were you referring to?
May 24, 2013 at 1:55 PM
I have the WP7.1 / 8.0 version.
I can replicate the issue by adding that configuration. If I remove that configuration, no memory leak occurs.

Are you using anonymous methods for the timer event?
The memory analyzer shows that you might use string concatenation without stringbuilder / string.concat, thus using +. That can cause leaks too.
May 28, 2013 at 6:49 AM
Turning off the SlidingAdDisplaySeconds has helped a bit, but still I am suffering a memory problem because of the AdControl.
I have 2 PhoneApplicationPages, both with a usercontrol with the AdControl in it. If I keep switching those pages, memory usage keeps rising. It does not drop after GC Collect. It keeps rising, until it is above 90mb and the app crashes. So, this is a major problem!

I have tried to make AdControl NULL, Dispose it, etc. No help.
If I remove the AdControl from my user control, memory keeps steady around 30mb.

I have no idea how to fix it, am I the only one with this problem?
Coordinator
May 28, 2013 at 12:13 PM
Apologies, trying to look into this today. My dev environment has been down the last week or so I haven't had a chance to properly look into it.
To help speed things along, could you send a repo app using your code or if you are OK with it, zip up your project and send me a link to it via mail (via the contact page on my blog, darkgenesis.zenithmoon.com)
May 28, 2013 at 7:44 PM
No problem, but I have no time creating test apps. I have implemented the other AdRotator (Unified Ad
Which works like a charm at the moment.

Keep up the good work, I hope this memory leak was only in my app and no other people experience it.