mixpanel / mixpanel-react-native

Official React Native Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
105 stars 44 forks source link

React native app crashing for both android and ios on adding mixpanel events due to out of memory issue #216

Closed Priyanka-SP closed 6 months ago

Priyanka-SP commented 10 months ago

Dear team

We are using the mix panel tool for our apps developed using react native.

Recently we added additional logs to our app and post that our users started complaining about crash of the app. We saw some crash reports pointing to mix-panel where it says ‘out of memory’. Observed in iOS and Android platforms.

Mix-panel react native version being used V1.3.7

Does the latest version (2.3.1) fixes this issue? Or is it a known issue? Can you help us on highest priority?

See more details: "crashException": "java.lang.OutOfMemoryError", "crashFingerprint": "29a5b75a754d761971219ca0669bf783-3377921-1134387395", "crashLocation": "AnalyticsMessages.java line 286 in com.mixpanel.android.mpmetrics.AnalyticsMessages$MixpanelMessageDescription.", "crashLocationClass": "com.mixpanel.android.mpmetrics.AnalyticsMessages$MixpanelMessageDescription", "crashLocationFile": "AnalyticsMessages.java", "crashLocationLineNumber": 286, "crashLocationMethod": "", "crashMessage": "Failed to allocate a 150994952 byte allocation with 25165824 free bytes and 134MB until OOM, target footprint 152111784, growth limit 268435456", "device": "Samsung Phone", "deviceGroup": "Phone",

zihejia commented 6 months ago

hi @Priyanka-SP , You can set a smaller batch size to reduce the memory footprint. The Flush Batch Size represents the number of events sent in a single network request to the Mixpanel server. While the default value is 50, you can reduce it to 10 by using setFlushBatchSize(10). I am closing this issue for now. Please feel free to reopen it if the problem persists.