SQLite Forum

Default MMAP limit on 64 bit
Login

Default MMAP limit on 64 bit

(1) By Roger Binns (rogerbinns) on 2023-10-25 15:16:53 [source]

SQLite's default mmap limit SQLITE_MAX_MMAP_SIZE is 2GB. This is a very appropriate value for 32 bit and is almost the entire address space depending on platform. Memory mapping still requires using pragmas or config to get a database to use a non-zero value which is always capped at SQLITE_MAX_MMAP_SIZE.

However for 64 bit and multi-gigabyte databases this limit won't even cover the database, and is a trivial portion of the address space. Unfortunately this upper limit can only be changed at compile time, which is very tricky to do for those using language wrappers and/or system libraries.

I think SQLite should use a far larger SQLITE_MAX_MMAP_SIZE default for 64 bit environments. Does anyone see any downsides?