From 9d04934f1136bd9f8c99916abc7c0d16463579e2 Mon Sep 17 00:00:00 2001 From: Alex Miller Date: Mon, 12 Nov 2018 13:44:41 -0800 Subject: [PATCH] Don't allocate magazines backed by hugepages on systems that support them. Doing so causes an excessive amount of memory to be wasted. See issue #909. --- flow/FastAlloc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flow/FastAlloc.cpp b/flow/FastAlloc.cpp index b69ae9024f..9a853219a0 100644 --- a/flow/FastAlloc.cpp +++ b/flow/FastAlloc.cpp @@ -374,7 +374,10 @@ void FastAllocator::getMagazine() { ASSERT( block == desiredBlock ); #endif #else - block = (void **)::allocate(magazine_size * Size, true); + // FIXME: We should be able to allocate larger magazine sizes here if we + // detect that the underlying system supports hugepages. Using hugepages + // with smaller-than-2MiB magazine sizes strands memory. See issue #909. + block = (void **)::allocate(magazine_size * Size, false); #endif //void** block = new void*[ magazine_size * PSize ];