4

I want to run sqlite in an embedded application. What's the bare minimum requirement to be able to run sqlite for maintaining a database? I'm looking at implementing the R*tree for spatial searches. It would be helpful if I could get an explanation justifying the requirements.
Would a cortex M0/cortex M3 with with about 32kb of ram be enough? How much flash memory will i need?
I'm looking at storing the database itself on an SD card.

chilljeet
  • 302
  • 2
  • 15
  • 1
    I think that you should make some experiments. SQLite uses dynamic memory allocation. In environments with such low amount of RAM it tends to be real pain. From my experience of porting Freetype to similiar CPU - don't use system malloc/free, as you won't know what's happening, use http://hempeldesigngroup.com/embedded/stories/memorymanager/ and supply it with uint8_t[] buffer of different sizes. Check also that page: https://www.sqlite.org/malloc.html – rkrahl Feb 13 '15 at 07:51
  • [Size Of The SQLite Library](http://www.sqlite.org/footprint.html) – CL. Feb 13 '15 at 10:17
  • 1
    Possible duplicate of [Sqlite on an embedded system](http://stackoverflow.com/questions/178264/sqlite-on-an-embedded-system) – thinwybk Nov 08 '16 at 12:36

1 Answers1

5

From About SQLite

...the size of the SQLite library can be reduced below 300KiB. SQLite can also be made to run in minimal stack space (4KiB) and very little heap (100KiB)...

D Krueger
  • 2,446
  • 15
  • 12