Hi Simon, In my application I have multiple separate processes, not threads. I believe the shared cache doesn't work across processes. I essentially want a single shared read-only database that can be accessed at high speed. Since the data set can become quite large and with multiple processes requiring access to the identical data, I wanted to have the database in shared memory. The database will contain reference information with which the data I'm processing must be enriched. So once the database has been loaded in memory, it will remain static and its contents will never change.
Best regards, Jaco On Saturday, November 3, 2012, Simon Slavin wrote: > > On 3 Nov 2012, at 12:26pm, Jaco Breitenbach > <jjbreitenb...@gmail.com<javascript:;>> > wrote: > > > My application consists of several indepent processes that must all > access > > (read) the same data table during processing. In order to optimise > memory > > usage I was wondering if it is possible to load an in-memory SQLite > > database into shared memory. > > Not simply and not without a little strangeness. However, SQLite has a > Shared Cache mode which is easy to use, and you can open your database on > disk, but declare a really big cache size for it. This will remove the > need to use an in-memory database since SQLite will gradually read the > whole database in to the cache. Read this: > > <http://www.sqlite.org/sharedcache.html> > > and this: > > <http://www.sqlite.org/pragma.html#pragma_cache_size> > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org <javascript:;> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Sent from Gmail Mobile _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users