| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | SQLite memory calculator | |||||||||||||||||||||||||
2 | ||||||||||||||||||||||||||
3 | Connection/database | Page size (bytes) | Cache required (pages) | Memory required (KiB) | SQLITE_CONFIG_PAGECACHE Memory required (KiB) | |||||||||||||||||||||
4 | Alpha | 512 | 1000 | 500 | 500 | |||||||||||||||||||||
5 | Beta | 512 | 2000 | 1000 | 1000 | |||||||||||||||||||||
6 | Gamma | 512 | 128 | 64 | 64 | |||||||||||||||||||||
7 | ... add more connections here... | |||||||||||||||||||||||||
8 | ||||||||||||||||||||||||||
9 | ||||||||||||||||||||||||||
10 | Largest page size (bytes) | 512 | ||||||||||||||||||||||||
11 | Total cache requirements (pages) | 3128 | ||||||||||||||||||||||||
12 | Number of connections | 3 | ||||||||||||||||||||||||
13 | Lookaside size (KiB) | 120 | ||||||||||||||||||||||||
14 | ||||||||||||||||||||||||||
15 | ||||||||||||||||||||||||||
16 | Entry | Memory requirement (KiB) | Comment | |||||||||||||||||||||||
17 | Page cache | 1564 | 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 reserve | 1024 | 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 | Scratch | 9 | Number of threads using SQLite is approximated to the number of connections. May need to increase the factor if there are more threads | |||||||||||||||||||||||
20 | Lookaside | 360 | ||||||||||||||||||||||||
21 | General-purpose | 4096 | Arbitrarily chosen | |||||||||||||||||||||||
22 | Total | 7053 | ||||||||||||||||||||||||
23 | Soft limit buffer | 1024 | Since the soft limit is, well, soft, we make some distance to the hard heap limit, to allow a certain overflow | |||||||||||||||||||||||
24 | Soft limit | 6029 | ||||||||||||||||||||||||
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 |