Hi again Numo and others,

I am looking further into this problem. I hope I am not asking stupid questions.

I can confirm definitely that my program, when started by 'xinetd' still give the following result: (As previous email)

  sqlite3_open(sDatabaseFile, &hSqlite) (= SQLITE_OK)

Immediately Before:
  VmData:            484 kB
Immediately After:
  VmData:          16872 kB


The *same* code hacked to run from the command line shows this:

Immediately Before:
  VmData:            464 kB
Immediately After:
  VmData:           4584 kB


Sqlite acquires almost exactly four times less memory.

A run of valgrid reports:

==11969== malloc/free: in use at exit: 12789 bytes in 99 blocks.
==11969== malloc/free: 110 allocs, 11 frees, 14337 bytes allocated.
==11969==
==11969== searching for pointers to 99 not-freed blocks.
==11969== checked 5812648 bytes.
==11969==
==11969== LEAK SUMMARY:
==11969==    definitely lost: 0 bytes in 0 blocks.
==11969==      possibly lost: 136 bytes in 2 blocks.
==11969==    still reachable: 12653 bytes in 97 blocks.
==11969==         suppressed: 0 bytes in 0 blocks.



This brings up more questions that is answers:

Is the allocation of 4108 KB normal for Sqlite?
Why, then run from xined, is the memory allocation four times as much?
Why is just Sqlite effected by being run from xinetd?

Any inspiration from any users very welcome!

Ben



Ben Clewett wrote:
Hi Numo and others,

I am very glad to hear the consensus is that there is nothing wrong with libsqlite3.so.0.8.6.

However the fact is that the 'open' still acquires 16MB of memory.

Immediately Before:

  VmSize:           8572 kB
  VmLck:               0 kB
  VmRSS:            2252 kB
  VmData:            484 kB
  VmStk:              88 kB
  VmExe:              20 kB
  VmLib:            6772 kB
  VmPTE:              20 kB

Immediately After:

sqlite3_open(sDatabaseFile, &hSqlite) (= SQLITE_OK)

  VmSize:          24960 kB
  VmLck:               0 kB
  VmRSS:            2368 kB
  VmData:          16872 kB
  VmStk:              88 kB
  VmExe:              20 kB
  VmLib:            6772 kB
  VmPTE:              24 kB

I can't use valgrind as this is a TCP daemon, so I will have to build some form of simulator to investigate further....

Thanks,

Ben


Nuno Lucas wrote:
On 10/27/06, Ben Clewett <[EMAIL PROTECTED]> wrote:
I am linking to libsqlite3.so.0.8.6.  After calling sqlite3_open(...) I
find my programs data memory jumps by 16392 Kb.

This seems a lot.  The database I am opening is only 26K in size.

There are many different ways of memory "jump" (like linking with a
lot of dynamic libraries), but one thing is certain: sqlite is not
responsible for that.

I have a similar process opening about 90 times.  This obviously
consumes a very large amount of memory, 1.4G with 90 processes.

It's a memory leak in your program, for sure. Run some memory leak
tool (e.g. valgrind).

May I ask if this is what would be expected, and whether there is
anything I can do to lower this loading?

Unless you decided to mess with sqlite internals, it's not expected in any way.

Thanks for your help,

Ben.

Best regards,
~Nuno Lucas

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------





--
Ben Clewett
+44(0)1923 460000
Project Manager
Road Tech Computer Systems Ltd
http://www.roadrunner.uk.com

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to