From dd5c91eb439af1688a57c90f910b8b1b5665a744 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 28 Oct 2021 14:28:01 +0100 Subject: [PATCH] Change Remote Cache default size With the new snmalloc2 changes it seems the larger window is leading to more fragmentation and harming performance. Reducing size still provides good batching, improves memory overhead. --- src/mem/allocconfig.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mem/allocconfig.h b/src/mem/allocconfig.h index ce294e8..323c566 100644 --- a/src/mem/allocconfig.h +++ b/src/mem/allocconfig.h @@ -16,14 +16,6 @@ namespace snmalloc #endif ; - // Return remote small allocs when the local cache reaches this size. - static constexpr int64_t REMOTE_CACHE = -#ifdef USE_REMOTE_CACHE - USE_REMOTE_CACHE -#else - 1 << 20 -#endif - ; enum DecommitStrategy { /** @@ -91,4 +83,13 @@ namespace snmalloc static_assert( MIN_ALLOC_SIZE >= (sizeof(void*) * 2), "MIN_ALLOC_SIZE must be sufficient for two pointers"); + + // Return remote small allocs when the local cache reaches this size. + static constexpr int64_t REMOTE_CACHE = +#ifdef USE_REMOTE_CACHE + USE_REMOTE_CACHE +#else + 1 << MIN_CHUNK_BITS +#endif + ; } // namespace snmalloc