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

Fix excessive mmap-ing in LMDB (cherrypick of #11513) #11516

Merged
merged 1 commit into from Feb 3, 2021

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Feb 3, 2021

Problem

Core dumps collected on macOS are very large currently because they include all mmap'd data. According to vmmap, this is because LMDB is mmap'ing 1.7TB of data. And... it is! But not intentionally.

Solution

ShardedLmdb was not dividing the max_size by the number of shards, and since each shard used their own LMDB Environment, we were ending up with 16 * max_size mmap'd. Additionally, we had set some of our databases to sizes that are well beyond what we expect the database to grow to when GC is running consistently.

Result

It is now possible to gather core dumps on macOS, which should assist in the debugging of #11364.

[ci skip-build-wheels]

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks!

### Problem

Core dumps collected on macOS are very large currently because they include all mmap'd data. According to `vmmap`, this is because LMDB is `mmap`'ing 1.7TB of data. And... it is! But not intentionally.

### Solution

`ShardedLmdb` was not dividing the `max_size` by the number of shards, and since each shard used their own LMDB `Environment`, we were ending up with `16 * max_size` `mmap`'d. Additionally, we had set some of our databases to sizes that are well beyond what we expect the database to grow to when GC is running consistently.

### Result

It is now possible to gather core dumps on macOS, which should assist in the debugging of pantsbuild#11364.

[ci skip-build-wheels]
@stuhood stuhood force-pushed the stuhood/pick-11513-for-2.2.x branch from 457e666 to 859f147 Compare February 3, 2021 21:49
@stuhood stuhood merged commit 75f984f into pantsbuild:2.2.x Feb 3, 2021
@stuhood stuhood deleted the stuhood/pick-11513-for-2.2.x branch February 3, 2021 23:34
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.

None yet

2 participants