On 11/14/18, Aubrey Barnard <barn...@cs.wisc.edu> wrote:
>
> $ ~/opt/bin/sqlite3 -pagecache 4096 1234 :memory: "pragma cache_size"
> "pragma cache_size = -1000" "pragma cache_size"
> Expected output:
> -4936
> -1000
> Actual output:
> -2000
> -1000

The PRAGMA cache_size=N sets a soft upper bound on the number of cache
buffers that will be used.  The -pagecache option uses
sqlite3_config(SQLITE_CONFIG_PAGECACHE) to use a separate memory
allocation as the initial memory pull from which to draw cache
buffers.  These are different things, and so one does not necessarily
change the other.

The PRAGMA cache_size=N is used to limit memory usage.

The SQLITE_CONFIG_PAGECACHE option is designed to reduce memory
fragmentation.  See
https://www.sqlite.org/malloc.html#_page_cache_memory for further
information on what that means and why it is important for some
systems.  (Hint: Unless you are working on a safety-critical embedded
system, this probably is not important to you.)

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to