Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a forked version of LMDB to fix a memory usage issue #1

Merged
merged 3 commits into from
Jun 21, 2021

Conversation

Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented Jun 15, 2021

The forked LMDB repository introduces a new MDB_ALWAYSFREEPAGES flag that forces LMDB to call free on single pages instead of storing them in a list for future reuse.

The fact that LMDB was keeping the pages in memory was, pretty obviously, impacting the memory usage of the library when big transactions were created. Even after being committed, the memory usage was high. The only way to free the memory was to drop the environment.

We are not the sole ones that were impacted by this behavior.

@Kerollmops Kerollmops assigned curquiza and unassigned curquiza Jun 15, 2021
@Kerollmops Kerollmops requested a review from curquiza June 15, 2021 14:15
curquiza
curquiza previously approved these changes Jun 15, 2021
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

Wunderbar!

@curquiza curquiza changed the base branch from master to main June 16, 2021 18:02
@curquiza curquiza changed the base branch from main to master June 16, 2021 18:02
@curquiza curquiza changed the base branch from master to main June 17, 2021 12:08
@Kerollmops
Copy link
Member Author

bors merge

@bors
Copy link

bors bot commented Jun 21, 2021

Build succeeded:

@bors bors bot merged commit 9bc8b70 into main Jun 21, 2021
@bors bors bot deleted the hotfix-free-mdb-pages branch June 21, 2021 13:37
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.

2 participants