Skip to content
This repository was archived by the owner on Mar 9, 2019. It is now read-only.

Conversation

@mcuadros
Copy link

As #350 says in some cases the optimization to force the minimum file size to 1M is not very useful when your database is very small.

This PR introduce the Option.MinMmapSize param to allow lower sizes

@benbjohnson
Copy link
Member

Sorry for the delay. The 1MB minimum was pretty arbitrary. I'd actually be ok with just setting the min to 32KB. The minimum size is 20KB (2 meta pages, 1 free list page, 1 root page, and 1 bucket root page) so 32KB is the next highest power of 2.

Does that work for you?

@mcuadros
Copy link
Author

Yes, actually I fixed the value to 2, and in benchmarks work pretty similar. Thanks

benbjohnson added a commit to benbjohnson/bolt that referenced this pull request May 18, 2015
This commit adjusts the minimum mmap size from 1MB to 32KB. The
previous limit was arbitrary and causes wasted space for very small
databases.

Thanks to @mcuadros for submitting the original pull request:

  boltdb#351
@benbjohnson
Copy link
Member

@mcuadros I made the change to the minimum mmap size here: #375

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