Hi all, After a day of debugging and code changes I realised that SQLite rocks, it was some of my C code not getting cleaned up (basically structures returned from the Queue where not FREE'd properly). C coding is not my day job ...;-)
So lesson learnt: Do not blame SQLite for dodgy C code that needs to be cleaned up correctly... But anyway, the PRAGMA cache_size did help a lot.... Chat later Lynton -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lynton Grice Sent: 08 December 2010 03:03 PM To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Runtime memory growth concerns Hi there, I am playing with the PRAGMA cache_size and it seems to help lots. I will keep you posted ;-) Lynton -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Lynton Grice Sent: 07 December 2010 10:31 PM To: [email protected] Subject: Re: [sqlite] Runtime memory growth concerns Interesting, seems that for my queue implementation using SQLite in WAL mode if I keep a "global" connection handle open while the client is using the queue then the memory grows quickly..but if I open and close the handle on each SEND, RECEIVE etc then all is fine... Does this sound right? From: Lynton Grice [mailto:[email protected]] Sent: 07 December 2010 10:26 PM To: '[email protected]' Subject: RE: Runtime memory growth concerns Hi there, Regarding the message I sent earlier...Just a quick update from my side, it seems when I run the following sqlite3_step(stmt); The memory grows and does not get released in my specific case even though I set sqlite3_finalize(stmt); after it. The moment I comment out that sqlite3_step(stmt); line then all is "normal". Any ideas? Do I need to set some PRAGMA stuff to get the memory better? Thanks Lynton From: Lynton Grice [mailto:[email protected]] Sent: 07 December 2010 08:27 PM To: '[email protected]' Subject: Runtime memory growth concerns Hi there, I am a huge SQLite fan and am very curious as to why the following would happen. Essentially I have a "queue implementation" using SQLIte in WAL mode and it is working really well. However, at runtime if I watch the Task Manager in windows as thousands of messages are sent to it, the memory just grows and grows and grows. The moment I take out the queue stuff in my program the memory is fine. I have the database with the following settings: PRAGMA journal_mode=wal PRAGMA wal_checkpoint PRAGMA synchronous=normal PRAGMA temp_store=memory Is there something I could be doing wrong here? As an example here is some code that PEEKS a message off the queue: I am using the following sequence when I run queries on the database: sqlite3_prepare_v2 sqlite3_bind_parameter_index sqlite3_step sqlite3_finalize If you have any ideas why you think the memory is growing at a rapid rate please let me know? Many thanks ;-) Lynton _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

