Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

correct size of default memory map #11

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

mykmelez
Copy link

The LMDB docs for mdb_env_set_mapsize says that the default map size is 10,485,760 bytes, i.e. 10MiB. But the DEFAULT_MAPSIZE define in the LMDB code sets the default map size to 1,048,576 bytes, i.e. 1MiB.

I submitted a patch to fix the LMDB docs in issue 8322. That issue has been open for several years, and it isn't clear whether it's the docs or the DEFAULT_MAPSIZE define that is incorrect. But I suspect the former, since the comment above DEFAULT_MAPSIZE says it's "certainly too small for any actual applications," which suggests that the smaller size was intentional.

In any case, it's worth fixing the lmdb-rs docs to specify the correct value (even if the LMDB docs specify an incorrect one).

@mykmelez mykmelez requested a review from ncloudioj November 19, 2018 22:34
@mykmelez
Copy link
Author

(In addition to submitting a patch to the OpenLDAP project, I've previously requested integration of these changes upstream in danburkert#46 and would like to move forward with these changes downstream while awaiting that integration.)

@ncloudioj Does this seem reasonable?

Note: it's theoretically possible that the comment is correct, and it's the code that's incorrect. But code is the source of truth when the two disagree, so I've edited the comment here.

@ncloudioj
Copy link
Member

Makes sense. Let's keep rkv & lmdb-rs documents consistent.

Copy link
Member

@ncloudioj ncloudioj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+!

@mykmelez mykmelez merged commit 7e4914e into mozilla:master Dec 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants