aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-30 09:37:47 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-03-30 09:45:41 +0200
commit625488ace5c41ccba1b68323a72588000782f820 (patch)
tree54d5409d1417ded7f1a5b523a3d9fe2af06f8d6d /configure.ac
parentf34cdcbd806d3e7c9d5dbac2a201755a4cc9828b (diff)
downloadbitcoin-625488ace5c41ccba1b68323a72588000782f820.tar.xz
util: Work around (virtual) memory exhaustion on 32-bit w/ glibc
glibc-specific: On 32-bit systems set the number of arenas to 1. By default, since glibc 2.10, the C library will create up to two heap arenas per core. This is known to cause excessive virtual address space usage in our usage. Work around it by setting the maximum number of arenas to 1.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 2a9ee018a0..8aa9387dc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -574,6 +574,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
[ AC_MSG_RESULT(no)]
)
+dnl Check for mallopt(M_ARENA_MAX) (to set glibc arenas)
+AC_MSG_CHECKING(for mallopt M_ARENA_MAX)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
+ [[ mallopt(M_ARENA_MAX, 1); ]])],
+ [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOPT_ARENA_MAX, 1,[Define this symbol if you have mallopt with M_ARENA_MAX]) ],
+ [ AC_MSG_RESULT(no)]
+)
+
AC_MSG_CHECKING([for visibility attribute])
AC_LINK_IFELSE([AC_LANG_SOURCE([
int foo_def( void ) __attribute__((visibility("default")));