1.Dd March 11, 2017 2.Dt SQLITE3_MEMORY_USED 3 3.Os 4.Sh NAME 5.Nm sqlite3_memory_used , 6.Nm sqlite3_memory_highwater 7.Nd Memory Allocator Statistics 8.Sh SYNOPSIS 9.Ft sqlite3_int64 10.Fo sqlite3_memory_used 11.Fa "void" 12.Fc 13.Ft sqlite3_int64 14.Fo sqlite3_memory_highwater 15.Fa "int resetFlag" 16.Fc 17.Sh DESCRIPTION 18SQLite provides these two interfaces for reporting on the status of 19the sqlite3_malloc(), sqlite3_free(), 20and sqlite3_realloc() routines, which form the built-in 21memory allocation subsystem. 22.Pp 23The sqlite3_memory_used() routine returns the 24number of bytes of memory currently outstanding (malloced but not freed). 25The sqlite3_memory_highwater() routine returns 26the maximum value of sqlite3_memory_used() since 27the high-water mark was last reset. 28The values returned by sqlite3_memory_used() and 29sqlite3_memory_highwater() include any overhead 30added by SQLite in its implementation of sqlite3_malloc(), 31but not overhead added by the any underlying system library routines 32that sqlite3_malloc() may call. 33.Pp 34The memory high-water mark is reset to the current value of sqlite3_memory_used() 35if and only if the parameter to sqlite3_memory_highwater() 36is true. 37The value returned by sqlite3_memory_highwater(1) 38is the high-water mark prior to the reset. 39.Sh SEE ALSO 40.Xr sqlite3_malloc 3 , 41.Xr sqlite3_memory_used 3 , 42.Xr sqlite3_malloc 3 43