From fc96d258c56ba5e48f5d6307ea7680cb77db82eb Mon Sep 17 00:00:00 2001 From: root Date: Tue, 17 Oct 2023 09:16:25 +0000 Subject: TSG-15374: enable jemalloc backgroud gc thread --- shaping/src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shaping/src/main.cpp') diff --git a/shaping/src/main.cpp b/shaping/src/main.cpp index f9a38b2..8143bce 100644 --- a/shaping/src/main.cpp +++ b/shaping/src/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "log.h" #include "utils.h" @@ -80,6 +81,14 @@ int main(int argc, char **argv) return -1; } + bool flag = true; + int ret = mallctl("background_thread", NULL, NULL, &flag, sizeof(flag)); + if (ret != 0) { + LOG_ERROR("%s: mallctl(background_thread) failed, ret %d", LOG_TAG_SHAPING, ret); + LOG_CLOSE(); + return -1; + } + ctx = shaping_engine_init(); if (!ctx) { return -1; -- cgit v1.2.3