From 60baa09ba02e7cef39cc5b616ddbd8a1ad73bc56 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 26 Aug 2019 22:01:48 -0400 Subject: [PATCH] rpmalloc: Switch back to using 2MB heap areas instead of 4MB. There seem to be some cases that severely fragment rpmalloc's heap, wasting large amounts of memory (in #15264, some 750+MB it appears are wasted this way.) This is a stop-gap measure to cut the wastage in half (or more) until a proper solution is implemented. --- src/system/libroot/posix/rpmalloc/rpmalloc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp index 4fd7fb9e9d..2bcb96cbef 100644 --- a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp +++ b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp @@ -61,9 +61,13 @@ #define DISABLE_UNMAP 0 #endif #ifndef DEFAULT_SPAN_MAP_COUNT +#ifdef __HAIKU__ +#define DEFAULT_SPAN_MAP_COUNT 32 +#else //! Default number of spans to map in call to map more virtual memory (default values yield 4MiB here) #define DEFAULT_SPAN_MAP_COUNT 64 #endif +#endif #if ENABLE_THREAD_CACHE #ifndef ENABLE_UNLIMITED_CACHE