Memory leak in AdMob banner ads contributing to OutOfMemory exceptions

3 views
Skip to first unread message

Andrew Simpson

unread,
5:12 AM (3 hours ago) 5:12 AM
to Google Mobile Ads SDK Developers

After noticing our Android apps increased crash rate in Google Play Console, investigations lead to an unexpected number of OOM exceptions. This was mitigated almost completely when we disabled AdMob ads.

After some investigations, we added code to capture unhandled exceptions locally, and ran our apps until we received an OOM. I've captured the heapdump from there and converted the hprof file. The only thing needed to reproduce this is to enable AdMob ads, and display banner ads, having them rotate as expected. (We are using AdMob via AppLovin, but these issues of OOM crashes disappear when we disable AdMob, and investigations appear to lead directly to the AdMob library, as i'll explain below).

This is from the MAT tool leak suspects report:
```
One instance of com.google.android.gms.ads.nonagon.signalgeneration.k loaded by dalvik.system.DelegateLastClassLoader @ 0x13150b10 occupies 41,583,280 (14.37%) bytes. The memory is accumulated in one instance of java.lang.Object[], loaded by <system class loader>, which occupies 37,175,312 (12.85%) bytes.

Thread m.ahy @ 0x12e8d208 has a local variable or reference to class m.ahy @ 0x131e9870 which is on the shortest path to java.lang.Object[16384] @ 0x239115e8. The thread m.ahy @ 0x12e8d208 keeps local variables with total size 528 (0.00%) bytes.

Keywords

  • com.google.android.gms.ads.nonagon.signalgeneration.k
  • dalvik.system.DelegateLastClassLoader
  • java.lang.Object[]```

To me, it looks like the `ArrayDeque` is being excessively used somewhere inside `signalgeneration`, keep around forever and never cleared, constantly growing over time, eventually leading to OOM crashes if the app lives long enough.

Please fix this leak, as it is preventing me from using google AdMob ads in my app, because we were starting to approach the "Bad Behavior" crash threshold on Google Play due the OOM exceptions, and AdMob is definitely contributing here.

Please let me know if there is any other diagnostic information i can provide to help fix this issue.

Screenshot 2024-07-05 193129.png
Reply all
Reply to author
Forward
0 new messages
Search
Clear search
Close search
Google apps
Main menu