mmap & block_cache

84 views
Skip to first unread message

Lucas Lersch

unread,
Aug 29, 2016, 3:15:04 AM8/29/16
to leveldb
leveldb mmaps up to 1000 files according to the posix environment. If each file is 2MB, that means that leveldb consumes up to 2GB of memory with mmap. Why the choice for mmap? Why not spending this 2GB in the block_cache?

Lucas Lersch

unread,
Oct 17, 2016, 6:05:56 PM10/17/16
to leveldb
So just to share the answer to my question. The block_cache is caching uncompressed data, while mmap is memory mapping compressed data (SSTable). Based on these information one can have a policy to decide where it is better to spend memory.

Additionally I have another question. What is the use of the TableCache?
Reply all
Reply to author
Forward
0 new messages