Re: [sqlite] Memory bloats when attaching database with WAL enabled

2011-01-26 Thread Simon Slavin

On 25 Jan 2011, at 5:08pm, Akbar Syed wrote:

> I stop my application and restart it again. During restart, since the
> databases are already existing, I do open all the databases (DB1, DB2 and
> DB3). And Attach DB2 and DB3.

Hold on.  If you're doing the attaching with an 'ATTACH' command there's no 
need to separately open the databases.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Memory bloats when attaching database with WAL enabled

2011-01-26 Thread Akbar Syed
I have switched to WAL in my application for I am quite impressed with its
write performances when compared to JOURNALING. After a bit struggle with
checkpointing, I could successfully adopt it, yet I encountered a strange
problem.
Here is the scenario of my application
I have more than one database in my application. (Let's say DB1, DB2 and
DB3)
When I start my application, I create all the databases (not memory based)
and keep the connections open. I attach DB2 and DB3 to DB1. All the
connections are open.
I perform database write operations. The memory usages are under the control
(approx 5MB)
I stop my application and restart it again. During restart, since the
databases are already existing, I do open all the databases (DB1, DB2 and
DB3). And Attach DB2 and DB3.
And during this attach i.e, with the very first attach of DB2 to DB1, the
memory usage has increased a lot (upto 64MB).

I have not done any memory optimizations yet, but this is quite strange
issue. I have not observed this problem when I was using Journaling.

I appreciate if someone provides me some information what might be going
wrong when WAL coupled with ATTACH?
I shall be thankful for your feedback and suggestions.

Regards,
-Akbar Syed
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users