Instabug / Instabug-Android

In-app feedback and bug reporting tool for apps.
https://instabug.com/
Other
188 stars 38 forks source link

Getting OutOfMemoryError #343

Closed KarimFikani closed 3 years ago

KarimFikani commented 3 years ago

Steps to Reproduce the Problem

Unable to reproduce. Saw the logs coming from customers

Stacktrace

java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 1162112 free bytes and 1134KB until OOM, target footprint 268435456, growth limit 268435456; failed due to fragmentation (largest possible contiguous allocation 96731136 bytes) (Most recent call first)
at java.lang.String.fastSubstring (String.java:-2)
at java.lang.String.substring (String.java:2069)
at android.database.DatabaseUtils.getSqlStatementType (DatabaseUtils.java:1498)
at android.database.sqlite.SQLiteDatabase.executeSql (SQLiteDatabase.java:2314)
at android.database.sqlite.SQLiteDatabase.execSQL (SQLiteDatabase.java:2257)
at com.instabug.library.internal.storage.cache.db.SQLiteDatabaseWrapper.execSQL (SourceFile:2)
at com.instabug.apm.b.a.b.d.a (SourceFile:3)
at com.instabug.apm.f.b.b.a (SourceFile:1)
at com.instabug.apm.a$b.run (SourceFile:1)

Instabug integration code

Instabug.Builder(application, apiKey)
                .setInvocationEvents(InstabugInvocationEvent.NONE)
                .setReproStepsState(State.ENABLED_WITH_NO_SCREENSHOTS)
                .build()
        BugReporting.setReportTypes(BugReporting.ReportType.BUG, BugReporting.ReportType.FEEDBACK)
        if (BuildConfig.DEBUG) {
            CrashReporting.setState(Feature.State.DISABLED)
        }

SDK Version

10.0

Android Version

10

Device Model

Samsung N975F

evelant commented 3 years ago

This seems related to https://github.com/firebase/firebase-android-sdk/issues/629#issuecomment-709434074

Instabug first causes a CursorWindowAllocationException which it seems to log without crashing. Then Firestore is impacted by the leaked cursor OOM from Instabug which crashes and takes down the app.

I suspect Instabug is leaking sqlite cursors (see the linked thread for more details about why this seems likely)

KarimFikani commented 3 years ago

🤷‍♂️

amrbrkt commented 3 years ago

@KarimFikani @AndrewMorsillo I highly recommend updating to our latest version 10.2.0. I'm closing this for now, but please feel free to reopen it if you still facing the same issue.