Could not allocate CursorWindow

后端 未结 3 1197
走了就别回头了
走了就别回头了 2020-12-06 01:33

I\'m operating on an SQLite3 database in my android app. I just read from the pre populated database that has 200k rows and 14 columns. Entries are words. Datatype

3条回答
  •  借酒劲吻你
    2020-12-06 01:53

    Android cursors read all the query results into memory, and have a limit of 1 MB for that data.

    This limit was chosen because this amount of data is likely to make your app run sluggishly on a mobile device.

    You should, if possible:

    • do the computations not in your code but in SQL;
    • query only the data that you need (i.e., do not use SELECT * but get only the columns you need, and use a WHERE filter);
    • read the data in smaller portions.

提交回复
热议问题