From 568f01f6c3e51ef4b24abe532237081a35e585f6 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Tue, 31 Mar 2020 13:48:06 +0000 Subject: [PATCH] Make jemalloc(3) default to retain:true on 64-bit platforms, like it already does on Linux and OSX. This results in significantly fewer calls to mmap(2). This should result in a small reduction in system CPU time and improved superpage usage. Reviewed by: markj Tested by: markj MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23874 --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h index b752b0e7856..c598d5e0731 100644 --- a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h +++ b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h @@ -72,6 +72,10 @@ # define LG_SIZEOF_PTR 3 #endif +#if LG_VADDR > 32 +# define JEMALLOC_RETAIN +#endif + #ifndef JEMALLOC_TLS_MODEL # define JEMALLOC_TLS_MODEL /* Default. */ #endif