Skip to content

Support PRAGMA mmap_size (unix) - #417

Open
ncruces wants to merge 3 commits into
mainfrom
mmap
Open

Support PRAGMA mmap_size (unix)#417
ncruces wants to merge 3 commits into
mainfrom
mmap

Conversation

@ncruces

@ncruces ncruces commented Aug 19, 2026

Copy link
Copy Markdown
Owner

This is still an experiment at this point.

Only Linux is supported: Windows is much harder, and otherwise we should probably follow SQLite and limit this to macOS and FreeBSD.

@ncruces ncruces changed the title Support PRAGMA mmap_size (linux) Support PRAGMA mmap_size (unix) Aug 20, 2026
@ncruces

ncruces commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

FreeBSD and macOS added.

For those willing to experiment, the feature is silently ignored if you try to map too much.

By default, each connection gets 256MB of memory (on 64-bit systems). This needs to be enough for everything, including the page cache, the WAL index, and now the memory mapping.

With that default config, limiting mmap_size to at most 64MB (PRAGMA mmap_size=67108864, _pragma=mmap_size(67108864)) is probably best, and enough to see the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant