When you have a temp database in memory it appears that you cannot release the 
memory for it.  Even after you remove (drop) all the tables in the temp 
database, memory usage does not decrease.  pragma shrink_memory does not free 
the memory and pragma temp.shrink_memory neither.  The memory can be recycled, 
however, because it is a database, albeit in RAM.

However, if you "attach" a memory database or a "memory overflowing to disk" 
database:

attach database '' as work; -- attaches a memory database that overflows to disk
OR
attach database ':memory:' as work; -- attach a pure memory database

you can then detach that database to free the memory used:

drop database work;

pragma shrink_memory then appears to release the page cache.

If you however use a temp database (as in temp.tablename) then (a) you cannot 
drop the temp database and (b) pragma shrink_memory no longer appears to free 
anything at all.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




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

Reply via email to