On Thu, Feb 9, 2012 at 5:45 AM, Jaco Breitenbach <jjbreitenb...@gmail.com>wrote:
> With 3.7.10 > sqlite_status(SQLITE_STATUS_PAGECACHE_SIZE) now returns 1312 bytes, > indicating a page cache header size of 288 bytes. This means that once > again my application is not using the preallocated buffer at all, but is > allocating cache with malloc() and is running out of memory. So I have to > change the header size constant, recompile and redeploy the application. > > In order to avoid this scenario in future with future releases of SQLite, > is there a way to determine the page cache header size within the code, > keeping in mind that the page cache is configured using sqlite3_config() * > before* the call to sqlite3_initialize()? > At startup, open a database and so some simple operations, then use sqlite3_status(SQLITE_STATUS_PAGECACHE_SIZE) to determine the optimal page size. Then close that connection and run sqlite3_shutdown(). Then use sqlite3_config() to set up your static pagecache allocation. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users