siara-cc / esp32_arduino_sqlite3_lib

Sqlite3 Arduino library for ESP32
Apache License 2.0
370 stars 66 forks source link

Disk I/O issues on SPIFFS #13

Closed txf- closed 4 years ago

txf- commented 5 years ago

Currently I'm trying to insert 1000+ entries into a db with a modified sqlite_bulk_data_insert.ino (to use SPIFFS).

I'm getting periodic disk I/O errors, seemingly at random, but with increasing frequency the larger the database becomes. Notably executing further inserts after the error presents no issues (until a certain limit on partition usage).

Looking at the heap values, they remain unchanged, could it be that the heap is getting fragmented?

Are periodic I/O errors expected?

siara-cc commented 5 years ago

I remember testing on SPIFFS, but don't remember what the outcome was. I will try it out again and get back to you.

siara-cc commented 5 years ago

I tried the example on SPIFFS, but I did not face the problems you have mentioned. I could not complete the test because of hardware failure.

About heap values, my opinion is that they plateau once there are no more new sized data need to be allocated. They seem not to change because the same sized data gets allocated and deallocated.

siara-cc commented 4 years ago

See new library https://github.com/siara-cc/sqlite_micro_logger_arduino. It overcomes all memory problems and corruption issues. However there are limitations. For documentation see: https://github.com/siara-cc/sqlite_micro_logger_c.