Anish Enos Mathew wrote:
> I would like to get a tool which gives me an accurate result.

There isn't one as there are too many variables.  Do you want to count
shared libraries?  The malloc() libraries generally don't return memory
to the operating system except for "larger" chunks (where "larger" is
defined by the library and possibly somewhat tunable).  Some operating
memory map files implicitly, explicitly or both.  Do you want those to
count?  If you use different data, you'll get different memory
fragmentation between runs.  What do you want to count then?

Tools like top and ps show you how the operating system accounts for the
process.  Even then they double count (shared libraries) and do various
different things for memory mapped files.

You never said what your ultimate goal is.  If you want deterministic
memory consumption then SQLite already has that.  See for example the
"PRAGMA cache_size" command (easy case) or the compile time define
SQLITE_ENABLE_MEMORY_MANAGEMENT (harder).  Of course SQLite still can't
control the behaviour of the malloc() or C library.

Roger

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

Reply via email to