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