Bug: OOM due to huge allocation originated from KXmlParser and com.google.android.gms.internal.ads

420 views
Skip to first unread message

Liran Barsisa

unread,
Jul 31, 2023, 10:54:43 AM7/31/23
to Google Mobile Ads SDK Developers
Recently I've noticed a common OOM crash which exist for now only for one user, but it's repeating.
This is what I have:

classpath 'com.google.gms:google-services:4.3.15'

And this is the crash information (also attached video):
https://console.firebase.google.com/u/0/project/app-manager-cdf2c/crashlytics/app/android:com.lb.app_manager/issues/2b6a49e4b42381f436458411babec7d2?time=last-seven-days&types=crash&sessionEventKey=64C78DAF025700013B993DDDE41A0EA6_1840374455962270714

Fatal Exception: java.lang.IllegalStateException: java.lang.OutOfMemoryError: Failed to allocate a 134218008 byte allocation with 25165824 free bytes and 121MB until OOM, target footprint 166120680, growth limit 268435456
       at android.app.SharedPreferencesImpl.awaitLoadedLocked(SharedPreferencesImpl.java:284)
       at android.app.SharedPreferencesImpl.getString(SharedPreferencesImpl.java:301)
       at com.google.android.gms.internal.ads.zzbbi.zzd(com.google.android.gms:play-services-ads-lite@@22.2.0:1)
       at com.google.android.gms.internal.ads.zzbbg.zza(com.google.android.gms:play-services-ads-lite@@22.2.0:3)
       at com.google.android.gms.internal.ads.zzbbp.zza(com.google.android.gms:play-services-ads-lite@@22.2.0:7)
       at com.google.android.gms.internal.ads.zzbbi.zzf(com.google.android.gms:play-services-ads-lite@@22.2.0:1)
       at com.google.android.gms.internal.ads.zzbbi.zze(com.google.android.gms:play-services-ads-lite@@22.2.0:11)
       at com.google.android.gms.internal.ads.zzbbj.zza(com.google.android.gms:play-services-ads-lite@@22.2.0:1)
       at com.google.android.gms.internal.ads.zzbbp.zza(com.google.android.gms:play-services-ads-lite@@22.2.0:7)
       at com.google.android.gms.internal.ads.zzbbk.zza(com.google.android.gms:play-services-ads-lite@@22.2.0:1)
       at com.google.android.gms.internal.ads.zzbnq.run(com.google.android.gms:play-services-ads-lite@@22.2.0:1)
       at java.lang.Thread.run(Thread.java:920)
Caused by java.lang.OutOfMemoryError: Failed to allocate a 134218008 byte allocation with 25165824 free bytes and 121MB until OOM, target footprint 166120680, growth limit 268435456
       at java.lang.StringFactory.newStringFromChars(StringFactory.java:112)
       at java.lang.StringBuilder.toString(StringBuilder.java:413)
       at com.android.org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1455)
       at com.android.org.kxml2.io.KXmlParser.next(KXmlParser.java:401)
       at com.android.org.kxml2.io.KXmlParser.next(KXmlParser.java:321)
       at com.android.internal.util.XmlPullParserWrapper.next(XmlPullParserWrapper.java:170)
       at com.android.internal.util.XmlUtils.readThisValueXml(XmlUtils.java:1567)
       at com.android.internal.util.XmlUtils.readThisMapXml(XmlUtils.java:1057)
       at com.android.internal.util.XmlUtils.readThisValueXml(XmlUtils.java:1621)
       at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:1537)
       at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:969)
       at android.app.SharedPreferencesImpl.loadFromDisk(SharedPreferencesImpl.java:171)
       at android.app.SharedPreferencesImpl.access$000(SharedPreferencesImpl.java:59)
       at android.app.SharedPreferencesImpl$1.run(SharedPreferencesImpl.java:140)

chrome_2023-07-31_17-54-05.zip

Mobile Ads SDK Forum Advisor

unread,
Jul 31, 2023, 3:48:45 PM7/31/23
to lbl...@gmail.com, google-adm...@googlegroups.com

Hi Liran,

Thanks for reaching out to the GMA SDK Forum.

Could you double check on your end if following this public forum guide does help you to resolve? If not, before I share this to the rest of the team, could you provide us some additional information on this privately? You can provide the following details via Reply privately to author option or send it directly to the link below.

  • App ID
  • Mediation adapter used(if any)
  • SDK version you're using
  • A copy of the memory profiler where this OutOfMemoryError issue is happening
  • Exact steps to reproduce the issue along with a minimal reproducible code

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002nZMaIQAW&entry.80707362=00190784

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:_00D1U1174p._5004Q2nZMaI:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team

 



Liran Barsisa

unread,
Jul 31, 2023, 6:54:37 PM7/31/23
to Google Mobile Ads SDK Developers
It's a crash from Crashlytics. There is no way I can reach the user there and tell him what are the steps and the profiler file.
As for SDK, I already mentioned it.
App ID is the package name, right? There is no mediation used.

Mobile Ads SDK Forum Advisor

unread,
Aug 1, 2023, 6:16:38 AM8/1/23
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi Liran,

Thank you for responding back. For App ID, you may find it using this guide: https://support.google.com/admob/answer/7356431?hl=en. Since you mentioned that it is not locally reproducible, can you provide the following information instead?
  • Affected devices
  • percentage occurrences of the crash as per Crashlytics

Liran Barsisa

unread,
Aug 12, 2023, 4:26:23 AM8/12/23
to Google Mobile Ads SDK Developers
OK I've attached the answer of app ID in the link you've provided, and a video of the issue on Crashlytics.
About affected devices and percentages, only one user has it so far, and he has "Samsung Galaxy Note10+" with Android 12. He had  1,158 crashes so far in the past 90 days.
However, I've noticed the version of the app that he had might have been older than what I've thought, so perhaps the version of Admob component is older.

Mobile Ads SDK Forum Advisor

unread,
Aug 14, 2023, 6:31:58 AM8/14/23
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi Liran,

Thank you for providing the requested information. Allow me to raise this to a wider team for further checking. I'll let you know the soonest they provide their feedback.

Mobile Ads SDK Forum Advisor

unread,
Aug 24, 2023, 2:05:39 PM8/24/23
to google-adm...@googlegroups.com, lbl...@gmail.com
Hi Liran,

The team was able to check your concern and mentioned that the SDK reference is trying to read shared preferences, and it's very specific to device: 100% crash on Samsung Galaxy Note on Android 12. Most likely a Samsung issue with their Android OS wrapper.

Liran Barsisa

unread,
Aug 24, 2023, 2:14:57 PM8/24/23
to Google Mobile Ads SDK Developers
So you've informed the manufacturer about this and it will get updated with a fix?

Mobile Ads SDK Forum Advisor

unread,
Aug 24, 2023, 6:18:55 PM8/24/23
to lbl...@gmail.com, google-adm...@googlegroups.com
Hello Liran,

I'm afraid addressing this issue is already beyond our scope. We recommend reaching out to Samsung's support team for this, considering that the affected device is very specific.

Liran Barsisa

unread,
Aug 24, 2023, 6:29:06 PM8/24/23
to Google Mobile Ads SDK Developers
But it's by using your SDK, and your SDK isn't open sourced so even if I would have done it, I wouldn't have been able to point them to the bug.
As Google is the one that made the SDK, and as Google has more connections with companies and offers its services on their product, it should be more of the responsibility of Google, not a spare-time developer that uses Admob...

Mobile Ads SDK Forum Advisor

unread,
Aug 25, 2023, 3:44:39 AM8/25/23
to lbl...@gmail.com, google-adm...@googlegroups.com
Hello Liran,

Thank you for responding back. We do understand your situation you are in right now. However, as this issue does not happen to other scenarios other than using Samsung Galaxy Note on Android 12, it would be best to reach out to Samsung's support team first as it is most probably an issue with their Android OS wrapper and possibly a known issue on their end that they are trying to fix.

Liran Barsisa

unread,
Aug 25, 2023, 4:15:03 AM8/25/23
to Google Mobile Ads SDK Developers
OK so do it. You have much more technical knowledge of how Admob SDK works behind the scenes, its capabilities and requirements than every person that uses the SDK.

Mobile Ads SDK Forum Advisor

unread,
Aug 25, 2023, 6:43:42 AM8/25/23
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi Liran,

Allow me to circle this back to a wider team to get their insight as well. I'll update this thread the soonest they provide their feedback.

Harpreet

unread,
Aug 25, 2023, 9:38:01 AM8/25/23
to Mobile Ads SDK Forum Advisor, lbl...@gmail.com, google-adm...@googlegroups.com
This is happening on an iOS phone.

Best Regards,
Harpreet Singh


--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/SJ4a9000000000000000000000000000000000000000000000RZXS5N00d2UFNllCSBGfhrtjFzd0mA%40sfdc.net.

Mobile Ads SDK Forum Advisor

unread,
Aug 25, 2023, 12:11:07 PM8/25/23
to hpsin...@gmail.com, google-adm...@googlegroups.com, lbl...@gmail.com
Hi,

The specific error message is an `OutOfMemory` error when accessing SharedPreferences. Shared preferences is a featured managed by the Samsung and their implementation of the OS wrapper. While the AdMob SDK is accessing this feature, we are doing so in a normal way. Please reach out to Samsung with this information as it is probably something other applications are experiencing.

Nick

ref:_00D1U1174p._5004Q2nZMaI:ref

Liran Barsisa

unread,
Aug 25, 2023, 3:20:40 PM8/25/23
to Google Mobile Ads SDK Developers
I don't have a direct communication to various OEMs as Google. Tell it to the proper department in Google that deals with such things. 
I'm not working at Google.

José Martin Reza Jiménez

unread,
Aug 26, 2023, 12:33:21 AM8/26/23
to Liran Barsisa, Google Mobile Ads SDK Developers
Le doy las gracias por tomarse el tiempo ,pero está está aplicación no la autoricé , al parecer alguien se está hacien pasar por mi 

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages