Sqlite Android Database Cursor Window Allocation of 2048 Kb Failed

Sqlite Cursor Window allocation 2048 kb failed

I have faced the same trouble as you. What I did is I went all over my application data classes and close all other cursor objects which were not closed. so I guess same happen in your application also, open your data classes and find the cursors that didn't closed and close them

Cursor window allocation of 2048 kb failed with rxjava adapter on room

It turns out that the problem was in RxJava's .subscribeOn(Schedulers.io()) for Flowable responses in RxJava Room adapter. Apparently it was starting threads but has never released them.
I've swapped Schedulers.io() on fixed thread pool with up to 20 threads and it does go away.

android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed even after closing cursor

I was querying the database from a service. When I did it from an activity, the problem never occurred again.

Alongside querying, I was reading from the serial port within the same service. Maybe that caused the problem. However, when I used an activity instead of the service, the problem never happened again.



Related Topics



Leave a reply



Submit