Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] OutOfMemoryError crashes #179

Closed
aurelhubert opened this issue Jan 31, 2024 · 2 comments · Fixed by #183
Closed

[Crash] OutOfMemoryError crashes #179

aurelhubert opened this issue Jan 31, 2024 · 2 comments · Fixed by #183
Assignees

Comments

@aurelhubert
Copy link

aurelhubert commented Jan 31, 2024

Expected Behavior

No OutOfMemory crashes

Current Behavior

We see a crazy number of crashes affecting a few users on Crashlytics (version 1.12.2):

This issue has 30,698 crash events affecting 7 users

Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 218125360 byte allocation with 25165824 free bytes and 118MB until OOM, target footprint 169589056, growth limit 268435456
       at java.util.Properties.loadConvert(Properties.java:546)
       at java.util.Properties.load0(Properties.java:390)
       at java.util.Properties.load(Properties.java:337)
       at com.amplitude.id.utilities.PropertiesFile.load(PropertiesFile.kt:22)
       at com.amplitude.id.FileIdentityStorage.<init>(FileIdentityStorage.kt:23)
       at com.amplitude.id.FileIdentityStorageProvider.getIdentityStorage(FileIdentityStorage.kt:71)
       at com.amplitude.core.Amplitude$build$built$1.invokeSuspend(Amplitude.kt:105)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at java.lang.Thread.run(Thread.java:1012)

Possible Solution

No idea

Steps to Reproduce

No idea

Environment

Screenshot 2024-01-31 at 12 11 32
@phillipthelen
Copy link

We started seeing this today as well. one user with over 1000 crashes in 4 days. The app crashes every two minutes for that user. From where the crash happens, could the issue be that the file storing properties somehow gets too big and then the SDK fails initialising every time because it tries to load the entire file into memory?

@justin-fiedler justin-fiedler self-assigned this Mar 4, 2024
@justin-fiedler
Copy link
Contributor

I believe the users are getting into a “crash loop”

  • A lot of identifies are captured
  • SDK tried to load into memory
  • OOM error is thrown
  • App crashes
  • Repeat

The linked fix will catch the error, prevent a crash, and clear the "overloaded" file.

We will look more into the root cause and see if we can add better handling in a future PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants