summaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'malloc')
-rw-r--r--malloc/arena.c2
-rw-r--r--malloc/malloc.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index e96b3b42a6..6f4b0c497b 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -25,7 +25,7 @@
#define HEAP_MIN_SIZE (32*1024)
#ifndef HEAP_MAX_SIZE
# ifdef DEFAULT_MMAP_THRESHOLD_MAX
-# define HEAP_MAX_SIZE DEFAULT_MMAP_THRESHOLD_MAX
+# define HEAP_MAX_SIZE (2 * DEFAULT_MMAP_THRESHOLD_MAX)
# else
# define HEAP_MAX_SIZE (1024*1024) /* must be a power of two */
# endif
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 7ad26af069..02f659708d 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1427,12 +1427,12 @@ int __posix_memalign(void **, size_t, size_t);
#ifndef DEFAULT_MMAP_THRESHOLD_MAX
/* For 32-bit platforms we cannot increase the maximum mmap
threshold much because it is also the minimum value for the
- maximum heap size and its alignment. Going above 1MB wastes too
- much address space. */
+ maximum heap size and its alignment. Going above 512k (i.e., 1M
+ for new heaps) wastes too much address space. */
# if __WORDSIZE == 32
-# define DEFAULT_MMAP_THRESHOLD_MAX (1024 * 1024)
+# define DEFAULT_MMAP_THRESHOLD_MAX (512 * 1024)
# else
-# define DEFAULT_MMAP_THRESHOLD_MAX (8 * 1024 * 1024 * sizeof(long))
+# define DEFAULT_MMAP_THRESHOLD_MAX (4 * 1024 * 1024 * sizeof(long))
# endif
#endif