<[EMAIL PROTECTED]> wrote:
> ---- [EMAIL PROTECTED] wrote: 
> > <[EMAIL PROTECTED]> wrote:
> > > I completed my analysis of the SQLite database memory usage and I
was 
> > > surprised to find that SQLite consumes so much memory. I ran my
test 
> > > case (creates 31 tables) and found that SQLite consumed 545,231
bytes
> > > of malloced memory before it started giving it back. 
> > >  
> > 
> > 100K? yes.  20K? no.
> > 
> What is the set of commands to do this?
> Ray
> 

> There is no "command" to make SQLite use less memory.
> Rather you have to use careful engineering to keep
> the memory usage to a minimum.  Start with this:
>
>     PRAGMA default_cache_size=10;
>
> Then close your connection and reopen it and do this:
>
>     PRAGMA cache_size;
>
> Verify that you got a "10" back so that the change took.
>
> When you compile, you will want to leave out as much stuff
> as you do not need using SQLITE_OMIT_* flags.  You will
> want to take care in your use of SQL so that you do not
> specify SQL statements that inherently require a lot of
> memory.  You'll probably want to make use of
> sqlite3_soft_heap_limit() and sqlite3_release_memory().
> Stay far, far away from sqlite3_get_table().  And so
> forth.

Do we need to close the database connection and reopen it for the
setting of cache_size to be effective?

How do we reduce the memory by setting the cache_size? Will there be any
freeing up of memory in case where cache_size is reduced?

Regards,
Phani




-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to