Skip to content

Commit

Permalink
HPCC-16731 Set MALLOC_ARENA_MAX for better glibc malloc performance
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>
  • Loading branch information
mckellyln committed Jan 3, 2017
1 parent 0640462 commit ce6b45e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion initfiles/sbin/hpcc_setenv.in
Expand Up @@ -81,7 +81,16 @@ IFS="${OIFS}"
umask ${OUMASK}

# use less heap when threaded
export MALLOC_ARENA_MAX=8
# but if set too low it can affect performance significantly
num_arenas=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
if [ -z "$num_arenas" ] ; then
num_arenas = 8
elif [ $num_arenas -lt 8 ] ; then
num_arenas = 8
elif [ $num_arenas -gt 32 ] ; then
num_arenas = 32
fi
export MALLOC_ARENA_MAX=$num_arenas

PATH_PREFIX=`cat ${HPCC_CONFIG} | sed -n "/\[${SECTION}\]/,/\[/p" | grep "^path *= *" | sed -e 's/^path *= *//'`

Expand Down

1 comment on commit ce6b45e

@mckellyln
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous PR was: #9441

Please sign in to comment.