Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Android Admob 4.3.1 still has a memory leak.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tim Clark  
View profile  
 More options Nov 2 2011, 1:56 pm
From: Tim Clark <timoth...@gmail.com>
Date: Wed, 2 Nov 2011 10:56:02 -0700 (PDT)
Local: Wed, Nov 2 2011 1:56 pm
Subject: Android Admob 4.3.1 still has a memory leak.

It's very easy to reproduce. Just create 2 activities with ads and switch
back and forth between them... they will not get garbage collected

I posted a Stack Overflow question for 4.1.1 here:
http://stackoverflow.com/questions/7695576/android-admob-4-1-1-has-a-...

This includes a test project for v4.1.1 but it is still relevant because
the bug still exists.

WebRep
Overall rating


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
b0b  
View profile  
 More options Dec 3 2011, 8:16 pm
From: b0b <pujos.mich...@gmail.com>
Date: Sat, 3 Dec 2011 17:16:31 -0800 (PST)
Local: Sat, Dec 3 2011 8:16 pm
Subject: Re: Android Admob 4.3.1 still has a memory leak.

This is a real issue. I have this memory leak with orientation changes, as
explained in the stackoverflow page.
Following this page workaround which is to use a static AdView seems to
work, but it is still leaking the original Activity the static AdView is
constructed with
(this parameter):

 mAdView = new AdView(this, AdSize.BANNER, ADMOB_PUBLISHER_ID);

Isn't there a better solution to avoid this huge memory leak ?

Changing orientation 10-20 times in my app is sufficient to trigger an
OutOfMemoryException on
bitmap creation, and at this point 33Mb of native memory is used (!!!),
there is none left.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Zehavi  
View profile  
 More options Dec 6 2011, 3:06 am
From: Adam Zehavi <Adam.Zeh...@nu-art-software.com>
Date: Tue, 6 Dec 2011 00:06:52 -0800 (PST)
Local: Tues, Dec 6 2011 3:06 am
Subject: Re: Android Admob 4.3.1 still has a memory leak.
you can see my solution for the matter...

http://stackoverflow.com/questions/6148812/android-admob-causes-memor...

On Dec 4, 3:16 am, b0b <pujos.mich...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
b0b  
View profile  
 More options Dec 6 2011, 3:43 pm
From: b0b <pujos.mich...@gmail.com>
Date: Tue, 6 Dec 2011 12:43:59 -0800 (PST)
Local: Tues, Dec 6 2011 3:43 pm
Subject: Re: Android Admob 4.3.1 still has a memory leak.

You soution probably work, I will try it. It is better than to use a real
Activity which may consume way more memory.

Alternatively I've discovered that destroying the WebView in onDestroy()
greatly reduced the leak (but it still leaks a little):

void destroyWebView(ViewGroup viewGroup) {
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
            if (viewGroup.getChildAt(i) instanceof WebView) {
                WebView view = (WebView)viewGroup.getChildAt(i);
                viewGroup.removeView(view);
                view.destroy();                
                return ;
            }
        }
    }

protected void onDestroy() {
        super.onDestroy();
        ...
       adLayout.removeAllViews();   // admobView view is a child of adLayout
       destroyWebView(admobView);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »