Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory after 65 inserts #16

Open
basementmedia2 opened this issue Dec 29, 2020 · 2 comments
Open

Out of memory after 65 inserts #16

basementmedia2 opened this issue Dec 29, 2020 · 2 comments

Comments

@basementmedia2
Copy link

Hi,

sqlite works now with my esp8266 NodeMCU thanx to your library.
But the following code results in a "out of memory" message after approx. 65 dataset inserts:

randNumber=random(50);

   for (int i=1;i<1000;i=i+1) {
      char query[200];
      sprintf(query, "Insert into messungen (datum, liter) VALUES ('2020-12-20 20:59:00', %d);", randNumber);
      rc = db_exec(db1, query);
      if (rc != SQLITE_OK) {
         sqlite3_close(db1);
         return;
      }
      delay(100);
   }

I've set the stack size to 6144 in the following file:
/home/myuser/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/cores/esp8266/cont.h

Is there more i can try to get rid of the out of memory error?

Best wishes
Daniel

@siara-cc
Copy link
Owner

siara-cc commented Jan 1, 2021

What is the page size? For a low memory MCU like Sqlite, it does not work well if page size > 512

@basementmedia2
Copy link
Author

Hi, where/how can i set the page size? I am using SQLite Studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants