Skip to content

Commit 524b7e3

Browse files
committed
Merge bitcoin#19: Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems
4874cb8 Increase maximum number of read-only mmap()s used from 1000 to 4096 on 64 bit systems. (Clem Taylor) Pull request description: By default LevelDB will only mmap() up to 1000 ldb files for reading and then fall back to using file desciptors. The typical linux system has a 'vm.max_map_count = 65530', so mapping only 1000 files seems arbitarily small. Increase this value to another arbitrarily small value, 4096. Tree-SHA512: 42d0978f229603aa882ac47a43ec455be0e27c9c3e4d7e36f7e6b49bab6da7c1bd0d3ffbaca22dfda2a5722fa533d1ce7439e9f99fdedb64df0c4442bbb6a93c
2 parents 64052c7 + 4874cb8 commit 524b7e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/env_posix.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ static int MaxMmaps() {
585585
if (mmap_limit >= 0) {
586586
return mmap_limit;
587587
}
588-
// Up to 1000 mmaps for 64-bit binaries; none for smaller pointer sizes.
589-
mmap_limit = sizeof(void*) >= 8 ? 1000 : 0;
588+
// Up to 4096 mmaps for 64-bit binaries; none for smaller pointer sizes.
589+
mmap_limit = sizeof(void*) >= 8 ? 4096 : 0;
590590
return mmap_limit;
591591
}
592592

0 commit comments

Comments
 (0)