1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Improve the accuracy of the Pager heap usage estimate.

FossilOrigin-Name: ae89777e7f8bae2cdd3407395ea84c1b39577c4b
This commit is contained in:
drh
2010-07-28 17:36:11 +00:00
parent abc97a7834
commit 233f816b84
4 changed files with 16 additions and 14 deletions

View File

@@ -5414,9 +5414,11 @@ int sqlite3PagerRefcount(Pager *pPager){
** used by the pager and its associated cache.
*/
int sqlite3PagerMemUsed(Pager *pPager){
int perPageSize = pPager->pageSize + pPager->nExtra + 20;
int perPageSize = pPager->pageSize + pPager->nExtra + sizeof(PgHdr)
+ 5*sizeof(void*);
return perPageSize*sqlite3PcachePagecount(pPager->pPCache)
+ sqlite3MallocSize(pPager);
+ sqlite3MallocSize(pPager)
+ (pPager->pTmpSpace ? pPager->pageSize : 0);
}
/*