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:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user