Android: Fatal Exception - OutOfMemoryError, SQLiteDiskIOException, ANR

  • Updated

Reference Number: 1797, 1798, 1805, 1806, 1807, 1808

Summary: 

The following errors can occur under low memory conditions on certain devices. We will be working to fix these in the next major version.

Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1072KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:887)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:977)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1395)
at java.lang.UNIXProcess.initStreams(UNIXProcess.java:170)
at java.lang.UNIXProcess$2.run(UNIXProcess.java:143)
at java.lang.UNIXProcess$2.run(UNIXProcess.java:141)
at java.security.AccessController.doPrivileged(AccessController.java:69)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:141)
at java.lang.ProcessImpl.start(ProcessImpl.java:141)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider.checkForSupportLoggingEnabled(ThunderheadInitProvider.java:178)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider.access$checkForSupportLoggingEnabled(ThunderheadInitProvider.java:47)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$3.invokeSuspend(ThunderheadInitProvider.java:110)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)
main (timed waiting): tid=1 systid=16645
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(BlockingCoroutine.java:88)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(BuildersKt__BuildersKt.java:59)
at kotlinx.coroutines.BuildersKt.runBlocking(BuildersKt.java:1)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(BuildersKt__BuildersKt.java:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(BuildersKt.java:1)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider.onCreate(ThunderheadInitProvider.java:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7281)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6822)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6739)
at android.app.ActivityThread.access$1400(ActivityThread.java:244)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7700)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:887)
at com.thunderhead.utils.PreferenceManagerImpl.loadEditorNonBlocking(PreferenceManagerImpl.java:327)
at com.thunderhead.One.<init>(One.java:150)
at com.thunderhead.OneInternalProvider$DefaultDependencyProvider.getThunderheadOne(OneInternalProvider.java:1000)
at com.thunderhead.OneInternalProvider$DefaultDependencyProvider.getThunderheadContext(OneInternalProvider.java:859)
at com.thunderhead.OneInternalProvider.getThunderheadContext(OneInternalProvider.java:257)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1.invokeSuspend(ThunderheadInitProvider.java:130)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)
Fatal Exception: android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 4874 SQLITE_IOERR_SHMSIZE): , while compiling: PRAGMA journal_mode
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:903)
at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:648)
at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:333)
at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:298)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:217)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:195)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:503)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:204)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:196)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:880)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:865)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:729)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:355)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:298)
at com.thunderhead.OneInternalProvider$DefaultDependencyProvider.getWritableSQLiteDatabase(OneInternalProvider.java:834)
at com.thunderhead.OneInternalProvider.getWritableSQLiteDatabase(OneInternalProvider.java:442)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$2$1.invokeSuspend(ThunderheadInitProvider.java:104)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$2$1.invoke(ThunderheadInitProvider.java:8)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$2$1.invoke(ThunderheadInitProvider.java:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(UndispatchedKt.java:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(BuildersKt__Builders_commonKt.java:165)
at kotlinx.coroutines.BuildersKt.withContext(BuildersKt.java:1)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$2.invokeSuspend(ThunderheadInitProvider.java:97)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$2.invoke(ThunderheadInitProvider.java:8)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$2.invoke(ThunderheadInitProvider.java:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(UndispatchedKt.java:55)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.java:112)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.java:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(BuildersKt__Builders_commonKt.java:56)
at kotlinx.coroutines.BuildersKt.launch(BuildersKt.java:1)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(BuildersKt__Builders_commonKt.java:47)
at kotlinx.coroutines.BuildersKt.launch$default(BuildersKt.java:1)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1.invokeSuspend(ThunderheadInitProvider.java:96)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)
Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:887)
at android.net.ConnectivityThread.createInstance(ConnectivityThread.java:45)
at android.net.ConnectivityThread.access$000(ConnectivityThread.java:29)
at android.net.ConnectivityThread$Singleton.<clinit>(ConnectivityThread.java:36)
at android.net.ConnectivityThread.getInstanceLooper(ConnectivityThread.java:54)
at android.net.ConnectivityManager.getDefaultHandler(ConnectivityManager.java:3655)
at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:4049)
at com.thunderhead.android.infrastructure.network.ConnectionNetworkMonitor.<init>(ConnectionNetworkMonitor.java:76)
at com.thunderhead.android.infrastructure.network.ConnectionNetworkMonitor.access$getBuildVersion$p(ConnectionNetworkMonitor.java:23)
at com.thunderhead.android.infrastructure.network.ConnectionNetworkMonitor.<init>(ConnectionNetworkMonitor.java:29)
at com.thunderhead.OneInternalProvider$DefaultDependencyProvider.getConnectionNetworkMonitor(OneInternalProvider.java:930)
at com.thunderhead.OneInternalProvider.getConnectionNetworkMonitor(OneInternalProvider.java:422)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1.invokeSuspend(ThunderheadInitProvider.java:126)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)
Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:887)
at android.app.SharedPreferencesImpl.startLoadFromDisk(SharedPreferencesImpl.java:142)
at android.app.SharedPreferencesImpl.<init>(SharedPreferencesImpl.java:130)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:498)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:479)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:188)
at com.thunderhead.android.infrastructure.sharedpreferences.BasePreferences.getSharedPreferences(BasePreferences.java:18)
at com.thunderhead.android.infrastructure.sharedpreferences.ThunderheadPreferences.<init>(ThunderheadPreferences.java:13)
at com.thunderhead.OneInternalProvider$DefaultDependencyProvider.getPreferences(OneInternalProvider.java:1491)
at com.thunderhead.OneInternalProvider$DefaultDependencyProvider.getAdminConfigPreferences(OneInternalProvider.java:1523)
at com.thunderhead.OneInternalProvider.getAdminConfigPreferences(OneInternalProvider.java:517)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1$2$1.invokeSuspend(ThunderheadInitProvider.java:91)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoopImplBase.java:274)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(BlockingCoroutine.java:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(BuildersKt__BuildersKt.java:59)
at kotlinx.coroutines.BuildersKt.runBlocking(BuildersKt.java:1)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(BuildersKt__BuildersKt.java:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(BuildersKt.java:1)
at com.thunderhead.android.infrastructure.initialization.ThunderheadInitProvider$onCreate$1$1.invokeSuspend(ThunderheadInitProvider.java:86)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)

Workaround: No workaround

Status: Resolved.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request