Raymond Hurst <[EMAIL PROTECTED]> wrote: > Hi Scott, > > Ooops..meant to say the following. > > My initial evaluation of this database was that it allocates memory for > each operation on the database. It returns the memory only when the > database is CLOSED. So the behavior you see is normal. > Ray Hurst >
No. SQLite does maintain a cache of the database file. It will hold up to 2000 pages by default. You can change the cache size by using the "PRAGMA cache_size=N" pragma. You can set N as small as 10. The cache does not grow beyond its limit. If you compile with -DSQLITE_ENABLE_MEMORY_MANAGMENT=1 the you can use the sqlite3_soft_heap_limit() interface to limit the total amount of memory SQLite will use. You can also use sqlite3_release_memory() to get SQLite to give up memory out of its cache. If you compile with -DSQLITE_MEMORY_SIZE=nnnn then SQLite will *never* call malloc(). Instead, it uses a static array that is nnnn bytes in size for all of its memory needs. You can get by with as little as 100K or so of memory, though the more memory you provide, the faster it will run. 5MB is a good value. In the next release, we might provide a new C interface or a pragma or both that will flush the cache. -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------