3

In my android app I store data in local SQLite database. Until size of this DB is less then 8-9 mb, everything works like a charm; however, once DB size is about 9 mb it keeps writing in the logcat:

 Window is full: requested allocation 228 bytes, free space 192 bytes, window size 2097152 bytes

Which results in very very long time on simple queries like SELECT * WHERE

What do I do wrong? What may be the problem? I checked my Cursor object, I close it everywhere, and only when db size is above this point Cursor sends warnings.

Thanks!

UDATE: I use "application inner database", not sd card one. Might switching to an SD card location help?

Roman
  • 2,079
  • 4
  • 35
  • 53

2 Answers2

0

Without seeing your code or even testing your app it's really hard to say at this point:

So, check your queries and read up on the limits of sqlite. You could move your db to the sd card like the linked question OP did but he was loading up database stored images.

Community
  • 1
  • 1
cbrulak
  • 15,436
  • 20
  • 61
  • 101
  • Thanks for your thoughts, really seems like Cursor Window is full link. I don't store images, but store quite big amounts of text. What would you recommend in this case? Store text in .txt files on /sdcard? Actually, I switched to /sdcard database, a bit faster now, but problem exists – Roman May 22 '13 at 17:07
  • 1
    I think you might want to update your queries to only pull the big amounts of text when needed. Like I said, it's hard to say without seeing your code. But do you really need to query all columns? Surely you're not rendering all that text all the time, so look at getting the big text when needed or optimizing by storing small snippets of that text, etc. – cbrulak May 22 '13 at 17:24
  • I use WHERE LIKE ´%%´ queries to pull data, maybe also impacts performance. But anyway thanks for advice, seems reasonable – Roman May 22 '13 at 17:29
  • I was also getting this issue but my case was a little different. I was trying to access some column with null value. – Khawar Raza Jan 28 '14 at 17:34
0

write text in a file and store file into external storage, and insert only path of a file

Rajesh Koshti
  • 572
  • 1
  • 7
  • 25