1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

When the -statstep option is passed to the "rbu" executable, print out memory stats right before exiting, as well as every -statstep steps.

FossilOrigin-Name: 94f81b51176566409b7d16b30d861f48ad15bb43a145df6e02e0880f7c348109
This commit is contained in:
dan
2020-12-15 16:28:07 +00:00
parent 84b168ffa7
commit 0bf333467c
3 changed files with 14 additions and 7 deletions

View File

@ -183,6 +183,13 @@ int main(int argc, char **argv){
break;
}
if( nStatStep>0 ){
sqlite3_int64 nUsed;
sqlite3_int64 nHighwater;
sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &nUsed, &nHighwater, 0);
fprintf(stdout, "memory used=%lld highwater=%lld\n", nUsed, nHighwater);
}
sqlite3_free(zErrmsg);
return (rc==SQLITE_OK || rc==SQLITE_DONE) ? 0 : 1;
}