High cpu usage even when using pauseTimers()

75 views
Skip to first unread message

Ricardo Lage

unread,
Oct 25, 2014, 7:56:59 PM10/25/14
to google-adm...@googlegroups.com
Hi,

I've been following this issue since I started using AdMob and every time there is a sdk update, the problem of high cpu usage when my Android app goes into the background appears again. Here is how absurd the situation is at the moment. On the onPause() of my Activity, I have to call the following methods:

            mAdView.pause();
            adWebView.stopLoading();
            adWebView.pauseTimers();
            adWebView.destroy();
            mAdView.removeAllViews();
            mAdLayout.removeView(mAdView);
            mAdLayout.removeAllViews();
            mAdView.destroy();
            mAdView = null;
            mAdLayout = null;

Even being as far way from ideal as it is, at least this was working just fine. But it seems something changed somewhere in the last sdk update (or in the Android SDK 5.0? I can't know). In reading about it, I'm seeing some discussions that pauseTimers() might actually not pause properly (see https://issues.apache.org/jira/browse/CB-4560 or https://code.google.com/p/chromium/issues/detail?id=350588 for examples, although I'm not sure these are related). It also seems others are having similar problems (see https://groups.google.com/forum/#!searchin/google-admob-ads-sdk/pauseTimers|sort:date/google-admob-ads-sdk/1aidjtsin8A/OisvDvu54t0J and https://groups.google.com/forum/#!searchin/google-admob-ads-sdk/pauseTimers|sort:date/google-admob-ads-sdk/dYeHyCqVVvU/4wjfxRKho1IJ for examples).

In my case, the above code does not work anymore. After leaving my app I can still see its process running when I enable Android's "show CPU usage" option. If I don't enable ads at all in my app, the problem is gone.

Any updates on this?

Thank you,
Ricardo

Eric Leichtenschlag

unread,
Oct 27, 2014, 9:34:10 PM10/27/14
to google-adm...@googlegroups.com
I can assure you that the SDK engineers are aware of the issue. Unfortunately I don't have any updates to report at the moment.

Andro Tuning

unread,
Aug 18, 2015, 11:43:31 AM8/18/15
to Google Mobile Ads SDK Developers
This issue seem to have been discovered back in 2010 and it's still unresolved! How funny can this be? An april's joke that's lasting forever maybe?

I can reproduce that on Lollipop and even the latest Android M/Marshmallow!

Is it that Google doesn't want us to use their mobile platforms on Android at all? Because it surely look like this! Developping app with such a buggy library is only going to raise complaints from our users!
Reply all
Reply to author
Forward
0 new messages