On Thursday, 13 February, 2020 17:58, Jim Dodgen <jim.dod...@gmail.com> wrote:

>I have often wondered what the performance difference is between /dev/shm
>and :memory: databases

Theoretically a :memory: database is faster than a /dev/shm stored database.  A 
:memory: database is purely in memory and has no extra connection cache (and no 
transactions to speak of).  A database in /dev/shm is just like an on-disk 
database, and the connection has its own memory cache, the difference being 
that there will never be a wait to flush the OS cache to disk (the file exists 
only in the OS file cache).  Using a /dev/shm file will still require file 
read/write because it is a file as far as the application is concerned.

A file on /dev/shm will release all its space back to the OS free pool when the 
file is deleted but will persist until reboot when closed by the application 
(and not deleted).  A :memory: database will release its memory back to the OS 
when it is detached/closed.  A database opened on a RAMDISK will behave like a 
database on /dev/shm except that deleting the file will not release the space 
allocated for the RAMDISK back to the OS since the RAMDISK usually permanently 
allocates virtual storage for its contents when created.

-- 
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