Use libjemalloc if it's available for better memory usage

Fixes #6763

closes #7919
parent 470efd4e
......@@ -11,6 +11,7 @@
## Features
* Add the ability to assign roles in the admin panel [#7868](https://github.com/diaspora/diaspora/pull/7868)
* Improve memory usage with libjemalloc if available [#7919](https://github.com/diaspora/diaspora/pull/7919)
# 0.7.7.0
......
......@@ -202,6 +202,21 @@ diaspora.yml.example
"
fi
# Use libjemalloc if it's available for better memory usage
command -v ldconfig > /dev/null 2>&1
if [ $? -eq 0 ]; then
ldconfig=ldconfig
elif [ -x /sbin/ldconfig ]; then
ldconfig=/sbin/ldconfig
fi
if [ -n "${ldconfig}" ]; then
jemalloc_path=$(${ldconfig} -p | grep jemalloc | tr ' ' '\n' | grep '^/' | head -1)
if [ -n "${jemalloc_path}" ]; then
export LD_PRELOAD="${jemalloc_path}"
fi
fi
# Start Diaspora
printf "Starting Diaspora in $RAILS_ENV mode "
if [ -n "$PORT" ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment