-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Memtrie] No longer use mmap for memtrie arena. (#10132)
This solves an issue with the current memtrie implementation that mmap requires either NO_RESERVE or overcommit enabled, by avoiding mmap altogether. It's not actually necessary to have contiguous memory. We'll instead have chunks of contiguous memory. Individual allocations will be entirely within a chunk anyway. Instead of using `usize` to represent a position in the arena, we now use `ArenaPos`, which simply is just the chunk index and position within chunk. We just needed some simple tweaks to use ArenaPos everywhere and there are no big changes. I've picked 4MB as the chunk size, so that the memory overhead for not being able to allocate a big value is at most 8KB (I think in practice it's at most key size (2k?) + value size (4k?)) per chunk. So with 16GB of total size the overhead here is worst-case 32MB; on the other hand the overhead from having a last chunk is at most 4MB. So, that seems like a reasonable chunk size value to pick. @Ekleog I haven't forgotten about your comments on the original PR (#9541 ) . I'm just tackling the more blocker items first. I'll come back to address these comments before the whole thing is considered complete.
- Loading branch information
1 parent
451d4ef
commit ca852b7
Showing
12 changed files
with
231 additions
and
144 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.