Re: [sqlite] Concern over runtime memory growth?

2010-12-07 Thread Lynton Grice
Hi Max,

I'm testing on 2 systems, on Solaris 10 and Windows XP. I am using SQLIte
version sqlite 3_6_23

Any ideas?

Lynton

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Max Vlasov
Sent: 08 December 2010 08:07 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Concern over runtime memory growth?

On Wed, Dec 8, 2010 at 8:58 AM, Lynton Grice
<lynton.gr...@logosworld.com>wrote:

> Hi there,
>
>
> I have implemented a queue using SQLIte in WAL mode and it seems to be
> working well..
>
>
> Now that I am testing and send thousands of messages to the queue I am
> watching the memory growth of the application grow and grow.
>

Lynton , please report your OS and sqlite version

Max Vlasov
___
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


Re: [sqlite] Concern over runtime memory growth?

2010-12-07 Thread David Abdurachmanov

Hi,
Actually I am in the problem. I have some SQLite used in main application and 
1500-2000 lines of code in SQLite Extension, which is pretty much one big 
trigger. I free all the memory I allocate, I destroy all prepared statements, 
but I still leaking very badly. My application does not allow me to do very 
good memory analysis, but you can try running valgrind to check there you 
leaking memory. This is very amazing and smart tool. It checks memory usage 
during runtime.
Launch:valgrind --tool=memcheck --leak-check=full --show-reachable=yes 
--num-callers=20 --track-fds=yes --track-origins=yes -v ./myapp arg1 arg2 arg3 
...
I run in on different OS and libs versions, but it shows for me that I am 
leaking memory badly.
==3237== LEAK SUMMARY:==3237==    definitely lost: 307,400 bytes in 4,350 
blocks==3237==    indirectly lost: 0 bytes in 0 blocks==3237==      possibly 
lost: 1,567,208 bytes in 7,993 blocks==3237==    still reachable: 364,632 bytes 
in 3,045 blocks==3237==         suppressed: 0 bytes in 0 blocks
-david

> From: lynton.gr...@logosworld.com
> To: sqlite-users@sqlite.org
> Date: Wed, 8 Dec 2010 07:58:14 +0200
> Subject: [sqlite] Concern over runtime memory growth?
>
> Hi there,
>
>
>
> I have implemented a queue using SQLIte in WAL mode and it seems to be
> working well..
>
>
>
> Now that I am testing and send thousands of messages to the queue I am
> watching the memory growth of the application grow and grow.
>
>
>
> I have make a "queue shared lib / dll" and have seen that it is the SQLIte
> calls I am making that are causing memory to grow and grow as I have
> commented out other stuff and all is fine. So basically I have commented out
> the queue stuff and the application runs smooththe moment I add in the
> queue lib again the memory grows ;-(
>
>
>
> I have the following set:
>
>
>
> PRAGMA journal_mode=wal
>
> PRAGMA wal_checkpoint
>
> PRAGMA synchronous=normal
>
> PRAGMA temp_store=memory
>
>
>
> And when I open the queue I use:
>
>
>
> rc = sqlite3_open_v2(queueName,, SQLITE_OPEN_READWRITE |
> SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_CREATE, NULL);
>
>
>
> So as an example I have a function "peekByID"
>
>
>
> So the steps I follow are:
>
>
>
> sqlite3_prepare_v2(handle,peekText,-1,,0 );
>
> ..
>
> rc = sqlite3_step(stmt);
>
> ...
>
> sqlite3_finalize(stmt);
>
>
>
> But memory just grows and grows with this call.
>
>
>
> I have tried to open the queue and close the queue after each call and that
> seems to help, but surely that is not the answer?
>
>
>
> I have let the application run and it was still climbing at 500 MB
> memory.;-(
>
>
>
> I have noticed that when I comment out
>
>
>
> rc = sqlite3_step(stmt);
>
>
>
> it is much better
>
>
>
> Is their anything I can do to clean up the memory better? Or just get things
> neater?
>
>
>
> Thanks
>
>
>
> Lynton
>
> ___
> 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


Re: [sqlite] Concern over runtime memory growth?

2010-12-07 Thread Simon Slavin

On 8 Dec 2010, at 5:58am, Lynton Grice wrote:

> But memory just grows and grows with this call.
> 
> I have tried to open the queue and close the queue after each call and that
> seems to help, but surely that is not the answer?

Try it without these:

PRAGMA journal_mode=wal
PRAGMA wal_checkpoint

and see if your application works acceptably.

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


Re: [sqlite] Concern over runtime memory growth?

2010-12-07 Thread Max Vlasov
On Wed, Dec 8, 2010 at 8:58 AM, Lynton Grice wrote:

> Hi there,
>
>
> I have implemented a queue using SQLIte in WAL mode and it seems to be
> working well..
>
>
> Now that I am testing and send thousands of messages to the queue I am
> watching the memory growth of the application grow and grow.
>

Lynton , please report your OS and sqlite version

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