diff options
author | drh <drh@noemail.net> | 2010-07-26 11:59:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-07-26 11:59:40 +0000 |
commit | 643f35e4a6007bf126441bbacc50d3eb80abaeee (patch) | |
tree | 8c4e5be70609a8e6112c2533d617f953dab6f681 /src | |
parent | 174b9a166d293445dcc3075c292b78115b62be8f (diff) | |
download | sqlite-643f35e4a6007bf126441bbacc50d3eb80abaeee.tar.gz sqlite-643f35e4a6007bf126441bbacc50d3eb80abaeee.zip |
Update comments to better documentation the new memory measurement functions.
FossilOrigin-Name: 620bad035755449c4e6a762f01ef2b1d9e521c7c
Diffstat (limited to 'src')
-rw-r--r-- | src/sqlite.h.in | 21 | ||||
-rw-r--r-- | src/status.c | 10 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 3e18d22c4..89bcf1c40 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -5243,10 +5243,25 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); ** <dd>This parameter returns the number of lookaside memory slots currently ** checked out.</dd>)^ ** -** <dt>SQLITE_DBSTATUS_CACHE_USED</dt> -** <dd>^This parameter returns the approximate number of of bytes of heap -** memory used by all pager caches associated with the database connection. +** ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt> +** <dd>This parameter returns the approximate number of of bytes of heap +** memory used by all pager caches associated with the database connection.)^ ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +** +** ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt> +** <dd>This parameter returns the approximate number of of bytes of heap +** and lookaside memory used to store the schema for all databases associated +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** ^The full amount of memory used by the schemas is reported, even if the +** schema memory is shared with other database connections due to +** [shared cache mode] being enabled. +** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +** +** ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt> +** <dd>This parameter returns the approximate number of of bytes of heap +** and lookaside memory used by all prepared statements associated with +** the database connection.)^ +** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0. ** </dd> ** </dl> */ diff --git a/src/status.c b/src/status.c index 711827b50..fce355b8f 100644 --- a/src/status.c +++ b/src/status.c @@ -138,6 +138,11 @@ int sqlite3_db_status( break; } + /* + ** *pCurrent gets an accurate estimate of the amount of memory used + ** to store the schema for all databases (main, temp, and any ATTACHed + ** databases. *pHighwater is set to zero. + */ case SQLITE_DBSTATUS_SCHEMA_USED: { int i; /* Used to iterate through schemas */ int nByte = 0; /* Used to accumulate return value */ @@ -175,6 +180,11 @@ int sqlite3_db_status( break; } + /* + ** *pCurrent gets an accurate estimate of the amount of memory used + ** to store all prepared statements. + ** *pHighwater is set to zero. + */ case SQLITE_DBSTATUS_STMT_USED: { struct Vdbe *pVdbe; /* Used to iterate through VMs */ int nByte = 0; /* Used to accumulate return value */ |