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

App Crashes with java.lang.OutOfMemoryError: Failed to allocate a 32 byte allocation with 672880 free bytes and 657KB until OOM #208

Closed
BalaDakshina opened this issue Aug 5, 2024 · 1 comment
Assignees

Comments

@BalaDakshina
Copy link

Expected Behavior

App Should not crash when using Kotlin version of Amplitude SDK.

Current Behavior

App Crashes due to amplitude SDK running out of memory

Steps to Reproduce

  1. integrate the kotlin version of the SDK
  2. Run the app with invalid/fake apiKey.
  3. Error Log before crash:
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867019549-447: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867019549-447: open failed: ENOENT (No such file or directory)
Google Play Services SDK not found for app set id!
user id and device id are null; amplitude may not resolve identity
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867020387-898: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867020727-257: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867021175-235: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867020387-898: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867020727-257: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867021175-235: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867020387-898: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867020727-257: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867021175-235: open failed: ENOENT (No such file or directory)
Event storage file not found: /data/user/0/com.ford.fcsdriverinterface.mock/app_amplitude-disk-queue/$default_instance-15-1722867021569-825: open failed: ENOENT (No such file or directory)```

4. Crash Log: 

```FATAL EXCEPTION: pool-42-thread-1
                                                                                                    Process: com.ford.fcsdriverinterface.mock, PID: 17717
                                                                                                    java.lang.OutOfMemoryError: Failed to allocate a 32 byte allocation with 672880 free bytes and 657KB until OOM, target footprint 201326592, growth limit 201326592; giving up on allocation because <1% of heap free after GC.
                                                                                                    	at java.util.LinkedHashMap.newNode(LinkedHashMap.java:299)
                                                                                                    	at java.util.HashMap.putVal(HashMap.java:636)
                                                                                                    	at java.util.HashMap.put(HashMap.java:617)
                                                                                                    	at org.json.JSONObject.put(JSONObject.java:276)
                                                                                                    	at org.json.JSONTokener.readObject(JSONTokener.java:403)
                                                                                                    	at org.json.JSONTokener.nextValue(JSONTokener.java:104)
                                                                                                    	at org.json.JSONTokener.readArray(JSONTokener.java:449)
                                                                                                    	at org.json.JSONTokener.nextValue(JSONTokener.java:107)
                                                                                                    	at org.json.JSONArray.<init>(JSONArray.java:94)
                                                                                                    	at org.json.JSONArray.<init>(JSONArray.java:110)
                                                                                                    	at com.amplitude.core.utilities.FileResponseHandler.handleBadRequestResponse(FileResponseHandler.kt:62)
                                                                                                    	at com.amplitude.core.utilities.ResponseHandler.handle(Response.kt:138)
                                                                                                    	at com.amplitude.core.platform.EventPipeline$upload$1.invokeSuspend(EventPipeline.kt:145)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
                                                                                                    	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)
                                                                                                    	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@66d8626, java.util.concurrent.Executors$FinalizableDelegatedExecutorService@2e5e267]

Environment

  • Unity Plugin Version: 1.16.8
  • Device: Samsung Galaxy S23
  • Device OS and Version: Android 14
@izaaz
Copy link
Collaborator

izaaz commented Aug 9, 2024

@BalaDakshina - this has been fixed in version 1.17.1.

@izaaz izaaz closed this as completed Aug 12, 2024
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

No branches or pull requests

2 participants