Skip to content

Commit dd5c91e

Browse files
committed
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.
1 parent 19de27f commit dd5c91e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/mem/allocconfig.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ namespace snmalloc
1616
#endif
1717
;
1818

19-
// Return remote small allocs when the local cache reaches this size.
20-
static constexpr int64_t REMOTE_CACHE =
21-
#ifdef USE_REMOTE_CACHE
22-
USE_REMOTE_CACHE
23-
#else
24-
1 << 20
25-
#endif
26-
;
2719
enum DecommitStrategy
2820
{
2921
/**
@@ -91,4 +83,13 @@ namespace snmalloc
9183
static_assert(
9284
MIN_ALLOC_SIZE >= (sizeof(void*) * 2),
9385
"MIN_ALLOC_SIZE must be sufficient for two pointers");
86+
87+
// Return remote small allocs when the local cache reaches this size.
88+
static constexpr int64_t REMOTE_CACHE =
89+
#ifdef USE_REMOTE_CACHE
90+
USE_REMOTE_CACHE
91+
#else
92+
1 << MIN_CHUNK_BITS
93+
#endif
94+
;
9495
} // namespace snmalloc

0 commit comments

Comments
 (0)