ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
SQLite memory calculator
2
3
Connection/databasePage size (bytes)Cache required (pages)
Memory required (KiB)
SQLITE_CONFIG_PAGECACHE Memory required (KiB)
4
Alpha5121000500500
5
Beta512200010001000
6
Gamma5121286464
7
... add more connections here...
8
9
10
Largest page size (bytes)512
11
Total cache requirements (pages)3128
12
Number of connections3
13
Lookaside size (KiB)120
14
15
16
Entry
Memory requirement (KiB)
Comment
17
Page cache1564
Total amount of memory required for page cache. If SQLITE_CONFIG_PAGECACHE is used, this is scaled by the largest page size, else by the individual connections' page sizes
18
Cached statements reserve1024
Prepared statements are kept alive by the application, so SQLite/soft limit has no control over memory usage here. Make sure to set a max size on any app-level statement caches, and provide a reserve here.
19
Scratch9
Number of threads using SQLite is approximated to the number of connections. May need to increase the factor if there are more threads
20
Lookaside360
21
General-purpose4096Arbitrarily chosen
22
Total7053
23
Soft limit buffer1024
Since the soft limit is, well, soft, we make some distance to the hard heap limit, to allow a certain overflow
24
Soft limit6029
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100