[sqlite] sqlite 3.8.11 - binary size

2015-10-22 Thread Shuhrat Rahimov
Hi,
I am running sqlite3 v3.8.10 on an ARM Cortex-M4 based embedded system. The
minimal size I could achieve was 184 K. Do you really have 44.8 K? And how
much runtime RAM is used by your binary? My RAM usage is 72-74 K.

2015-10-22 10:51 GMT+02:00 Romain Crausaz :

> Dear,
>
> We have an embedded system using sqlite. I performed an update from
> version 3.7.11 to 3.8.11 and was surprized that the binary file sqlite3 has
> grown from 44.8 KB to 627.4 KB. I used the same configuration (default) for
> both cross-compilation.
>
> The system has a limited amount of NAND memory and this make it unusable
> in our case.
>
> Is this memory increase normal or am I doing something wrong ?
>
> The library size didn't increase. It is only the sqlite3 binary file.
>
> Best regards
> Romain Crausaz
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] vdbeUnbind return occasionally Error

2015-09-22 Thread Shuhrat Rahimov
thanks for the hint. I've tried with SQLITE_ENABLE_MEMORY_MANAGEMENT to
call sqlite3_release_memory() each time after sqlite3_step(). The memory
usage is different during the whole runtime of the device. At the beginning
it is 80 K and each time the released memory ranges from 0 to 1,7 K, only
once or twice 3,5 K was released. the highest memory usage was 86 K. But
anyway, despite of memory release, each time after power up there can be
executed only 450-500 inserts, then NOMEM is returned, but SQLite memory
usage at that time is only 82 K. Maybe the memory is wasted for other
things and is not released properly. Any hints to this problem would be
very appreciated.
Kind Regards

2015-09-21 14:42 GMT+02:00 Richard Hipp :

> On 9/21/15, Shuhrat Rahimov  wrote:
> > What could I do here in order to free
> > memory after sqlite3_step() for further operations.
>
> https://www.sqlite.org/c3ref/db_release_memory.html
>
> --
> D. Richard Hipp
> drh at sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] vdbeUnbind return occasionally Error

2015-09-21 Thread Shuhrat Rahimov
Hello Richard,
thanks for your reply. I think I have found the problem. I do the
following: call sqlite3_bind_text() and then if successful I call
sqlite3_step() on the prepared statement and then call sqlite3_reset().
This sequence is called 20 times as one SQL transaction. I have noticed
that the problem occurs after about 20 transactions since power on. I have
noticed that before sqlite3_bind_text() returns Error 21, the
sqlite3_step() returns NO_MEM error. So, here maybe I am simply running out
of RAM. I have only 160 K of RAM. What could I do here in order to free
memory after sqlite3_step() for further operations.
Regards

2015-09-21 14:08 GMT+02:00 Richard Hipp :

> On 9/21/15, Shuhrat Rahimov  wrote:
> > Hi all,
> > I have ported SQLite to an embedded ARM Cortex M4 based processor. a bare
> > metal firmware is using SQLite, no OS. It seems to work but occasionaly
> > bindText function fails. So, I am doing 20 inserts as a one transaction,
> > but occasionally after 400-460 inserts bindText returns Error 21. I have
> > seen that it is occuring in vdbeUnbind function, log is: "bind on a busy
> > prepared statement". Could you help me to find out what the problem can
> be?
>
> The prepared statement is still in use when you try to call
> sqlite3_bind_text().  You can see this by adding "assert(
> sqlite3_stmt_busy(pStmt) );" right before you call
> sqlite3_bind_text(pStmt,...).  This is an application-level error, not
> a problem with SQLite or your port.
>
> You need to invoke sqlite3_reset() on a prepared statement that has
> been previously used before you run sqlite3_bind_text() on that
> prepared statement.
>
> --
> D. Richard Hipp
> drh at sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


[sqlite] vdbeUnbind return occasionally Error

2015-09-21 Thread Shuhrat Rahimov
Hi all,
I have ported SQLite to an embedded ARM Cortex M4 based processor. a bare
metal firmware is using SQLite, no OS. It seems to work but occasionaly
bindText function fails. So, I am doing 20 inserts as a one transaction,
but occasionally after 400-460 inserts bindText returns Error 21. I have
seen that it is occuring in vdbeUnbind function, log is: "bind on a busy
prepared statement". Could you help me to find out what the problem can be?
Regards


[sqlite] VFS for an MCU internal flash

2015-07-13 Thread Shuhrat Rahimov
Hello,
I was trying to run SQLite on ARM Cortex M4 CPU. What I need is a minimal
SQLite without the most features. I have no file system, so I wanted to
save a single file db on the internal MCU flash. I have successfully cross
compiled SQLite for ARM Cortex M4. I have set among others compile time
options SQLITE_OS_OTHER=1 and SQLITE_THREADSAFE=0.  Now I wanted to
implement a VFS. I want to save db tables directly in internal flash
without a file system. I have difficulties to understand test_onefile.c
implementation provided by SQLite. How could I edit that file in order to
be able to write file content on the internal MCU flash? Please, could
someone explain it to me or give some links where it is explained?
Kind Regards