QSqlQuery.nex() and QSqlQuery.seek(i) crashes randomly. [SOLVED]
-
Hi everyone.
I have a huge database (40 GBs) in SQLite full of images and text and numbers and stuff.
I am trying to export all those images into a folder but I get random crashes after 300, 400 records are exported.
Any ideas? -
Hi,
Did you check the memory consumption of your application ?
What does a run through the debugger tell you ? -
@SGaist It crashes when it tries to execute nex() function.
I tried allocating and freeing memory inside the loop but it just crashes. And worst part is, not at the same record number. Each time it crashes at a random record number. -
Are you running a SELECT * query ? Or are you doing smaller batches ?
-
@SGaist it's actually SELECT *
Are you suggesting I should do smaller batches? (using LIMIT) How much is small? -
Indeed, as you wrote, you have 40GB database and I don't know the size of the images you have in there. So depending on that and the current number of entries you might be just filling your memory. Try starting with e.g. 100, if it resist increase the value.