From 5c1b0b1a3f8cc1bc0438205006460adb9cc8997f Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Tue, 24 Dec 2019 13:59:36 -0600 Subject: [PATCH 1/3] Set decay_ms to 0 if background_thread is unavailable --- cpp/src/arrow/memory_pool.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc index 70e9c663bd3..df7a62ee2a5 100644 --- a/cpp/src/arrow/memory_pool.cc +++ b/cpp/src/arrow/memory_pool.cc @@ -66,12 +66,15 @@ #define JEMALLOC_DEBUG_OPTIONS ",junk:true" #endif -const char* je_arrow_malloc_conf = - ("oversize_threshold:0" +const char* je_arrow_malloc_conf = ( + "oversize_threshold:0" +#ifdef USE_JEMALLOC_BACKGROUND_THREAD ",dirty_decay_ms:1000" ",muzzy_decay_ms:1000" -#ifdef USE_JEMALLOC_BACKGROUND_THREAD ",background_thread:true" +#else + ",dirty_decay_ms:0" + ",muzzy_decay_ms:0" #endif JEMALLOC_DEBUG_OPTIONS); // NOLINT: whitespace/parens From c2e2f601776a1b556bc086e7a247d0facdd2cd23 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Tue, 24 Dec 2019 14:14:20 -0600 Subject: [PATCH 2/3] clang-format --- cpp/src/arrow/memory_pool.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc index df7a62ee2a5..fbf6d526525 100644 --- a/cpp/src/arrow/memory_pool.cc +++ b/cpp/src/arrow/memory_pool.cc @@ -66,8 +66,8 @@ #define JEMALLOC_DEBUG_OPTIONS ",junk:true" #endif -const char* je_arrow_malloc_conf = ( - "oversize_threshold:0" +const char* je_arrow_malloc_conf = + ("oversize_threshold:0" #ifdef USE_JEMALLOC_BACKGROUND_THREAD ",dirty_decay_ms:1000" ",muzzy_decay_ms:1000" From 5af6c203ba8ccb5362516f3f20a05d776199c7dd Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 6 Jan 2020 14:41:20 +0100 Subject: [PATCH 3/3] Add comment --- cpp/src/arrow/memory_pool.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc index fbf6d526525..787c01b153e 100644 --- a/cpp/src/arrow/memory_pool.cc +++ b/cpp/src/arrow/memory_pool.cc @@ -73,6 +73,8 @@ const char* je_arrow_malloc_conf = ",muzzy_decay_ms:1000" ",background_thread:true" #else + // ARROW-6994: return memory immediately to the OS if the + // background_thread option isn't available ",dirty_decay_ms:0" ",muzzy_decay_ms:0" #endif