This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 188346eac4f [fix](memory) Fix Jemalloc hook failed to start BE with 
JDK 17 #33946
188346eac4f is described below

commit 188346eac4ff28e1fb9b9b8067b601e5961ef46e
Author: Xinyi Zou <[email protected]>
AuthorDate: Mon Apr 22 22:36:10 2024 +0800

    [fix](memory) Fix Jemalloc hook failed to start BE with JDK 17 #33946
---
 be/CMakeLists.txt                               | 5 +++++
 be/src/runtime/CMakeLists.txt                   | 2 +-
 build.sh                                        | 5 +++++
 regression-test/pipeline/performance/compile.sh | 1 +
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index f5d99c69962..2082aa8def8 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -72,6 +72,7 @@ option(USE_LIBCPP "Use libc++" OFF)
 option(USE_MEM_TRACKER, "Use memory tracker" ON)
 option(USE_UNWIND "Use libunwind" ON)
 option(USE_JEMALLOC "Use jemalloc" ON)
+option(USE_JEMALLOC_HOOK "Use jemalloc hook" ON)
 if (OS_MACOSX)
     set(GLIBC_COMPATIBILITY OFF)
     set(USE_LIBCPP ON)
@@ -87,6 +88,7 @@ message(STATUS "GLIBC_COMPATIBILITY is 
${GLIBC_COMPATIBILITY}")
 message(STATUS "USE_LIBCPP is ${USE_LIBCPP}")
 message(STATUS "USE_MEM_TRACKER is ${USE_MEM_TRACKER}")
 message(STATUS "USE_JEMALLOC is ${USE_JEMALLOC}")
+message(STATUS "USE_JEMALLOC_HOOK is ${USE_JEMALLOC_HOOK}")
 message(STATUS "USE_UNWIND is ${USE_UNWIND}")
 message(STATUS "ENABLE_PCH is ${ENABLE_PCH}")
 
@@ -341,6 +343,9 @@ endif()
 if (USE_JEMALLOC)
     add_compile_options(-DUSE_JEMALLOC)
 endif()
+if (USE_JEMALLOC_HOOK)
+    add_definitions(-DUSE_JEMALLOC_HOOK)
+endif()
 
 # Compile with libunwind
 if (USE_UNWIND)
diff --git a/be/src/runtime/CMakeLists.txt b/be/src/runtime/CMakeLists.txt
index a0b3b799a76..3bfec93edfc 100644
--- a/be/src/runtime/CMakeLists.txt
+++ b/be/src/runtime/CMakeLists.txt
@@ -25,7 +25,7 @@ set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/src/runtime")
 
 file(GLOB_RECURSE RUNTIME_FILES CONFIGURE_DEPENDS *.cpp *.cc)
 
-if (NOT USE_JEMALLOC OR NOT USE_MEM_TRACKER)
+if (NOT USE_JEMALLOC OR NOT USE_MEM_TRACKER OR NOT USE_JEMALLOC_HOOK)
     list(REMOVE_ITEM RUNTIME_FILES 
${CMAKE_CURRENT_SOURCE_DIR}/memory/jemalloc_hook.cpp)
 endif()
 
diff --git a/build.sh b/build.sh
index efa808652b6..99de71173ac 100755
--- a/build.sh
+++ b/build.sh
@@ -346,6 +346,9 @@ fi
 if [[ -z "${USE_JEMALLOC}" ]]; then
     USE_JEMALLOC='ON'
 fi
+if [[ -z "${USE_JEMALLOC_HOOK}" ]]; then
+    USE_JEMALLOC_HOOK='OFF'
+fi
 if [[ -z "${USE_BTHREAD_SCANNER}" ]]; then
     USE_BTHREAD_SCANNER='OFF'
 fi
@@ -446,6 +449,7 @@ echo "Get params:
     STRIP_DEBUG_INFO            -- ${STRIP_DEBUG_INFO}
     USE_MEM_TRACKER             -- ${USE_MEM_TRACKER}
     USE_JEMALLOC                -- ${USE_JEMALLOC}
+    USE_JEMALLOC_HOOK           -- ${USE_JEMALLOC_HOOK}
     USE_BTHREAD_SCANNER         -- ${USE_BTHREAD_SCANNER}
     ENABLE_STACKTRACE           -- ${ENABLE_STACKTRACE}
     DENABLE_CLANG_COVERAGE      -- ${DENABLE_CLANG_COVERAGE}
@@ -544,6 +548,7 @@ if [[ "${BUILD_BE}" -eq 1 ]]; then
         -DENABLE_PCH="${ENABLE_PCH}" \
         -DUSE_MEM_TRACKER="${USE_MEM_TRACKER}" \
         -DUSE_JEMALLOC="${USE_JEMALLOC}" \
+        -DUSE_JEMALLOC_HOOK="${USE_JEMALLOC_HOOK}" \
         -DENABLE_STACKTRACE="${ENABLE_STACKTRACE}" \
         -DUSE_AVX2="${USE_AVX2}" \
         -DGLIBC_COMPATIBILITY="${GLIBC_COMPATIBILITY}" \
diff --git a/regression-test/pipeline/performance/compile.sh 
b/regression-test/pipeline/performance/compile.sh
index cf4320f23b1..e0e40a71770 100644
--- a/regression-test/pipeline/performance/compile.sh
+++ b/regression-test/pipeline/performance/compile.sh
@@ -133,6 +133,7 @@ sudo docker run -i --rm \
                     && export EXTRA_CXX_FLAGS=-O3 \
                     && export USE_JEMALLOC='ON' \
                                        && export ENABLE_PCH=OFF \
+                    && export USE_JEMALLOC_HOOK='OFF' \
                     && export CUSTOM_NPM_REGISTRY=https://registry.npmjs.org \
                     && bash build.sh --fe --be --clean 2>&1 | tee build.log"
 set +x


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to