Siddharth Jain wrote:
Hello,
can someone help me understand this parameter: http://www.lmdb.tech/doc/group__mdb.html#gaa2506ec8dab3d969b0e609cd82e619e5
- why does a user need to specify this apriori? Other databases don't require user to declare the size of the db beforehand. its not something a user knows in
advance.
It's not the size of the database. It's the maximum size the database will be allowed to grow to. Of course you don't need to know the actual size of the DB in advance.
You ought to know how much storage you're willing to commit to the DB. At most, it is the size of the free space on your storage device.
As for why: because setting the maximum size once, up front, gives higher performance than incrementally growing during runtime. If you don't care about performance, and can't handle this question, use some other slower DB.
- quoting: "The size of the memory map is also the maximum size of the database.". what happens when the size of the db overflows this parameter?
It can't overflow. The DB will reject writes when it reaches that limit.
- what is the trade-off if a user sets this parameter too large thanĀ is necessary?
The map just uses virtual address space, which is limited to 128TB on current 64bit CPUs. If you try to use all of that up, you won't have space for shared libraries in that process.
S.