Closed kaeawc closed 8 years ago
thanks I found a few probably causes for this. thanks. develop should have the fixes now.
I've also encountered similar error within my BaseAdapter class on the line where FlowCursorList is instantiated (adapter's constructor).
flowCursorList = new FlowCursorList<>(20, selectFrom);
This instantiation is called in Activity's onCreate() method, and I've reproduced this only by starting/destroying the activity multiple times - about 50 times fast starting/destroying activity (with the RecyclerView).
stacktrace:
Caused by android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. # Open Cursors=10 (# cursors opened by this proc=10)
at android.database.CursorWindow.<init>(CursorWindow.java:109)
at android.database.CursorWindow.<init>(CursorWindow.java:100)
at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
at android.database.sqlite.SQLiteCursor.clearOrCreateWindow(SQLiteCursor.java:301)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:139)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
at com.raizlabs.android.dbflow.list.FlowCursorList.setCacheModels(FlowCursorList.java:92)
at com.raizlabs.android.dbflow.list.FlowCursorList.<init>(FlowCursorList.java:54)
at com.raizlabs.android.dbflow.list.FlowCursorList.<init>(FlowCursorList.java:38)
Could it be the same cause?
NOTE: I haven't test the develop version. This encountered on the latest release version 2.2.1.
Found this crash occurring very intermittently on a model that extends
BaseCacheableModel
. Seems like a cursor isn't being closed in some edge case http://stackoverflow.com/questions/12029437/android-mysqlite-cursorwindowallocationexception-crashStack Trace: