siara-cc / esp_arduino_sqlite3_lib

Sqlite3 library for ESP8266 Arduino core
Apache License 2.0
91 stars 19 forks source link

(D) Can't open database: out of memory for ESP8266.... #1

Closed fred2088 closed 5 years ago

fred2088 commented 5 years ago

Sketch uses 589664 bytes (56%) of program storage space. Maximum is 1044464 bytes. Global variables use 68196 bytes (83%) of dynamic memory, leaving 13724 bytes for local variables. Maximum is 81920 bytes.

siara-cc commented 5 years ago

Hi, the free memory is too low (13724 bytes). Unfortunately SQLite requires lot of free heap and stack. Please see the limitations (https://github.com/siara-cc/esp_arduino_sqlite3_lib/#limitations-on-esp8266). Please try the example code and db first and work from there. In my case, I can't make it work if free memory is less than 20k.

siara-cc commented 5 years ago

Also, please check if your database page size is 512 bytes (using .dbinfo on command line of sqlite3).

siara-cc commented 5 years ago

Please see the new example sqlite3_small_db to see if it fits your use case. Also upgrading to ESP8266 2.4.2 SDK for Arduino frees up more RAM (need to increase stack size to 6144 again after upgrading).