Purpose of this buildpack
Jemalloc is a general purpose malloc implementation that works to avoid memory fragmentation in multithreaded applications. This buildpack makes it easy to install and use jemalloc with your apps.
Set up this buildpack for your application
This buildpack is designed to be used in conjunction with one or more additional buildpacks, thanks to the multi buildpack.
For instance, when creating a new Ruby app on Scalingo:
$ scalingo create my-app $ scalingo env-set BUILDPACK_URL=https://github.com/Scalingo/multi-buildpack.git $ cat << EOF > .buildpacks https://github.com/Scalingo/jemalloc-buildpack.git https://github.com/Scalingo/ruby-buildpack.git EOF
The above commands configure your application to use the multi buildpack, and
.buildpacks file. This file configures the different buildpacks to
apply. In this example, we configure the jemalloc and the Ruby buildpack.
JEMALLOC_ENABLED config option to true and jemalloc will be used for
all commands run inside of your containers.
scalingo env-set JEMALLOC_ENABLED=true
Per Container Type
To control when jemalloc is configured on a per container basis, use
and ensure that
JEMALLOC_ENABLED is unset.
web: jemalloc.sh bundle exec puma -C config/puma.rb
Choice of jemalloc version
Set this to select or pin to a specific version of jemalloc. The default is to use the latest stable version if this is not set. You will receive an error mentioning tar if the version does not exist.
note: This setting is only used during app deployment. Changing it will require a code change to be deployed in order to take affect.
scalingo env-set JEMALLOC_VERSION=3.6.0