This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 5fee7157ccf [fix](memory) Fix Jemalloc hook failed to start BE with
JDK 17 #33946
5fee7157ccf is described below
commit 5fee7157ccfc8ed88bc3405eb404a2916b5aac3e
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 | 6 ++++++
cloud/CMakeLists.txt | 3 +++
cloud/src/common/CMakeLists.txt | 2 +-
regression-test/pipeline/performance/compile.sh | 1 +
6 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 28b3fee115a..fd1f2c1db4a 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}")
@@ -346,6 +348,9 @@ endif()
if (USE_JEMALLOC)
add_definitions(-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 dbe6fb38b67..f813999f8ba 100755
--- a/build.sh
+++ b/build.sh
@@ -356,6 +356,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
@@ -461,6 +464,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}
ENABLE_INJECTION_POINT -- ${ENABLE_INJECTION_POINT}
@@ -563,6 +567,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}" \
@@ -606,6 +611,7 @@ if [[ "${BUILD_CLOUD}" -eq 1 ]]; then
-DSTRIP_DEBUG_INFO="${STRIP_DEBUG_INFO}" \
-DUSE_DWARF="${USE_DWARF}" \
-DUSE_JEMALLOC="${USE_JEMALLOC}" \
+ -DUSE_JEMALLOC_HOOK="${USE_JEMALLOC_HOOK}" \
-DEXTRA_CXX_FLAGS="${EXTRA_CXX_FLAGS}" \
-DBUILD_CHECK_META="${BUILD_CHECK_META:-OFF}" \
"${DORIS_HOME}/cloud/"
diff --git a/cloud/CMakeLists.txt b/cloud/CMakeLists.txt
index 35164af9f9c..9b9929ae1d5 100644
--- a/cloud/CMakeLists.txt
+++ b/cloud/CMakeLists.txt
@@ -188,6 +188,9 @@ endif ()
if (USE_JEMALLOC)
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DUSE_JEMALLOC")
endif()
+if (USE_JEMALLOC_HOOK)
+ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -DUSE_JEMALLOC_HOOK")
+endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -faligned-new")
diff --git a/cloud/src/common/CMakeLists.txt b/cloud/src/common/CMakeLists.txt
index a2abfb075bf..b18947b04a1 100644
--- a/cloud/src/common/CMakeLists.txt
+++ b/cloud/src/common/CMakeLists.txt
@@ -16,7 +16,7 @@ set(COMMON_FILES
network_util.cpp
)
-if (USE_JEMALLOC)
+if (USE_JEMALLOC AND USE_JEMALLOC_HOOK)
set(COMMON_FILES ${COMMON_FILES}
jemalloc_hook.cpp
)
diff --git a/regression-test/pipeline/performance/compile.sh
b/regression-test/pipeline/performance/compile.sh
index cfeae6af5f2..2a30fec0a7b 100644
--- a/regression-test/pipeline/performance/compile.sh
+++ b/regression-test/pipeline/performance/compile.sh
@@ -135,6 +135,7 @@ sudo docker run -i --rm \
&& export CCACHE_REMOTE_STORAGE=file:///root/ccache \
&& export EXTRA_CXX_FLAGS=-O3 \
&& export USE_JEMALLOC='ON' \
+ && export USE_JEMALLOC_HOOK='OFF' \
&& export ENABLE_PCH=OFF ${jdk17_str}\
&& export CUSTOM_NPM_REGISTRY=https://registry.npmjs.org \
&& bash build.sh --fe --be --clean 2>&1 | tee build.log"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]