简体   繁体   中英

What happens in Android if an SQLite query returns a result too large for memory?

I'm not sure what the memory limitations on Android applications are exactly, but let's say I run a query against SQLite and the result set is very large; too large to fit in whatever memory is allocated for my application. Will the application crash? I wonder if there's some trickiness that goes on in the Cursor class, with it maybe not retrieving all results at once? I don't really understand how Cursor works underneath.

Side effects of large memory consumption.

It may give OutOfMemoryError while reading data.

Because of too large memory consumption, it will increase CPU usage because of which battery will start draining out and if it goes beyond some limit (which I don't know) then Android system may kill your process or your application also might get crashed .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM