I use the room orm for saving data in my app. My app is running on android 5.1.1
and also I use androidx
in the project. But after a while I got the below exception:
Fatal Exception: android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.
at android.database.CursorWindow.(CursorWindow.java:108)
at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:226)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:148)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:142)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219)
at android.database.AbstractCursor.moveToNext(AbstractCursor.java:268)
at android.arch.persistence.room.InvalidationTracker$1.checkUpdatedTable(InvalidationTracker.java:358)
at android.arch.persistence.room.InvalidationTracker$1.run(InvalidationTracker.java:329)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
But indeed Room
manages Cursor
automatically and there isn't any Cursor
class in the whole project and furthermore, when this error happens there isn't any database-related transaction.