My app has an activity and a service. I recently introduce the Admob in my app.
However, I found it incredibly consuming the memory (5MB), and I can’t get my memory back after destroy it.
I use this in my layout.xml
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxx"
ads:adSize="BANNER">
Enable the admob in my onCreate
AdView adView = (AdView)this.findViewById(R.id.adView);
adView.loadAd(new com.google.ads.AdRequest());
Destory it on my onPause or onDestory
AdView adView = (AdView)this.findViewById(R.id.adView);
adView.destroyDrawingCache();
adView.destroy();
After destroy it, I still can’t get my 5mb memory back. Can somebody help pls?
p.s. My service is running on the background and I could see the 5mb is still there.
Thanks.
Tried other methods, none of them work. Also I’m using the latest Admob library 4.3.1.
The only solution works in my case is to call “System.exit(0)” somewhere in my app.
Then, the service will restart itself, and the memory consumed by Admob is also back.