File tree Expand file tree Collapse file tree 4 files changed +34
-0
lines changed
Expand file tree Collapse file tree 4 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -552,6 +552,14 @@ if(PLATFORM OR CLIENTTOOLS OR REMBED)
552552 install (FILES ${HPCC_SOURCE_DIR} /${LICENSE_FILE} DESTINATION "." COMPONENT Runtime)
553553endif ()
554554
555+ # Install jemalloc library from vcpkg
556+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND PLATFORM)
557+ file (GLOB JEMALLOC_LIBS "${VCPKG_INSTALLED_DIR} /${VCPKG_TARGET_TRIPLET} /lib/libjemalloc.*" )
558+ if (JEMALLOC_LIBS)
559+ install (FILES ${JEMALLOC_LIBS} DESTINATION "lib" )
560+ endif ()
561+ endif ()
562+
555563add_subdirectory (devel)
556564
557565#uninstall target
Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ mpStart=7101
3030mpEnd=7500
3131mpSoMaxConn=128
3232mpTraceLevel=0
33+
34+ useJemalloc=true
35+
3336# enable SSL for dafilesrv remote file access (SSLNone/false | SSLOnly/true | SSLFirst | UnsecureFirst | UnsecureAndSSL)
3437# Enabling requires setting the HPCCPassPhrase, HPCCCertFile, and HPCCPrivateKeyFile values
3538#dfsUseSSL=SSLNone
Original file line number Diff line number Diff line change @@ -130,6 +130,25 @@ if [ -z "$MALLOC_ARENA_MAX" ]; then
130130 export MALLOC_ARENA_MAX=$num_arenas
131131fi
132132
133+ # search env or conf file for useJemalloc=true/false setting and if true, add libjemalloc to LD_PRELOAD
134+ HPCC_XMLFILE=${HPCC_XMLFILE:- ${CONFIG_DIR} / ${ENV_XML_FILE} }
135+
136+ usejem=$( sed -n ' /\<envsettings/I,/\/envsettings/I{//!p;}' ${HPCC_XMLFILE} 2> /dev/null | awk -F ' [<>]' ' tolower($0)~/usejemalloc/{print $3}' 2> /dev/null)
137+ if [[ " $usejem " == " " ]] ; then
138+ usejem=$( grep -i usejemalloc ${HPCC_CONFIG} 2> /dev/null | awk -F= ' {print $2}' 2> /dev/null)
139+ if [[ " $usejem " == " " ]] ; then
140+ usejem=" false"
141+ fi
142+ fi
143+
144+ if [[ " $usejem " == " true" ]] ; then
145+ if [[ -s ${INSTALL_DIR} /lib/libjemalloc.so ]] ; then
146+ if [[ ! " $LD_PRELOAD " =~ .* libjemalloc.* ]] ; then
147+ LD_PRELOAD=${INSTALL_DIR} /lib/libjemalloc.so:${LD_PRELOAD}
148+ fi
149+ fi
150+ fi
151+
133152PATH_PREFIX=` cat ${HPCC_CONFIG} | sed -n " /\[${SECTION} \]/,/\[/p" | grep " ^path *= *" | sed -e ' s/^path *= *//' `
134153
135154export PID=` cat ${HPCC_CONFIG} | sed -n " /\[${SECTION} \]/,/\[/p" | grep " ^pid *= *" | sed -e ' s/^pid *= *//' `
Original file line number Diff line number Diff line change 104104 "name": "libiconv",
105105 "platform": "osx"
106106 },
107+ {
108+ "name": "jemalloc",
109+ "platform": "linux"
110+ },
107111 {
108112 "name": "libmemcached",
109113 "platform": "@VCPKG_MEMCACHED@ & !windows & !osx"
You can’t perform that action at this time.
0 commit comments