Skip to content

Commit

Permalink
Re-enable jemalloc's background thread by default (#9813)
Browse files Browse the repository at this point in the history
ref #9722, close #9812

Re-enable jemalloc's background thread by default

Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
  • Loading branch information
CalvinNeo authored Jan 22, 2025
1 parent c009246 commit 9832885
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dbms/src/Server/Setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ void setupAllocator([[maybe_unused]] const LoggerPtr & log)

LOG_INFO(log, "Got jemalloc config: opt.background_thread {}, opt.max_background_threads {}", old_b, old_max_thd);

if (!malloc_conf && !old_b)
bool not_config_bg = !malloc_conf || strstr(malloc_conf, "background_thread") == nullptr;
if (not_config_bg && !old_b)
{
// If the user doesn't explicitly set the background_thread opt, and it is actually false, then set it to true.
LOG_INFO(log, "Try to use background_thread of jemalloc to handle purging asynchronously");

RUN_FAIL_RETURN(je_mallctl("max_background_threads", nullptr, nullptr, (void *)&new_max_thd, sz_st));
Expand Down

0 comments on commit 9832885

Please sign in to comment.