Hello again,

Copying the database with Explorer and accessing it via sqlite is just
a contrived example that exhibits the same problem I'm having in my
application. The app does make a copy of the DB, but it has app-layer
locking that will prevent modifications unless someone decides to
start fiddling with the DB outside of my software (in which case I
have bigger problems). The app is multi-threaded, and a thread other
than the copying thread may attempt to open the DB and read from it
while the copy is occurring.

My contrived example aside, I just discovered that issuing the VACUUM
command on the same 20 GB DB in sqlite3 causes similar memory issues,
even when another process is not accessing the database file.
sqlite3.exe has a peak working set of 40 MB in Task Manager, but
Resource Monitor reports 99% Used Physical Memory (of 4 GB). If it
were all buffer cache, I'd expect that simply copying the file would
result in the same amount of memory being used, but it doesn't. I'm
going to head to a Windows forum to try to find out more about what's
happening, but the list users may want to be aware of this if they
plan on using large sqlite DBs with Windows 2008.

Thanks,
-Stan





On Wed, Jul 8, 2009 at 10:39 AM, Mark Spiegel<mspie...@vipmail.com> wrote:

> In the meantime, you may want to look at the backup interface provided
> by SQLite.  This should avoid any problems with getting an inconsistent
> snapshot which you just can't avoid with explorer even if you solve the
> RAM issue.  You could write a command line program that just performs a
> copy on a database in short order to use in place of explorer.  Someone
> here could probably post pseudo code for that in just a few minutes.
> Maybe this presents its own set of problems, I don't know.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to