summaryrefslogtreecommitdiff
path: root/shaping/src/main.cpp
diff options
context:
space:
mode:
authorroot <[email protected]>2023-10-17 09:16:25 +0000
committerroot <[email protected]>2023-10-17 09:16:25 +0000
commitfc96d258c56ba5e48f5d6307ea7680cb77db82eb (patch)
tree4c5ce57821a2d3345eb2c14000dcb67ec7cb5710 /shaping/src/main.cpp
parent32d1ede9d57af683c942d5ab0ecd41b66a1efd56 (diff)
TSG-15374: enable jemalloc backgroud gc thread
Diffstat (limited to 'shaping/src/main.cpp')
-rw-r--r--shaping/src/main.cpp9
1 files changed, 9 insertions, 0 deletions
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 <unistd.h>
#include <assert.h>
#include <signal.h>
+#include <jemalloc/jemalloc.h>
#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;