← Back

jemalloc is on by default for new apps

Improvement

New apps on native clusters now start with LD_PRELOAD=libjemalloc.so.2 in their environment variables, so Puma and Sidekiq run on jemalloc instead of glibc malloc. Rails apps typically see noticeably lower and flatter memory use with no code changes.

It's an ordinary environment variable, so you stay in control:

  • Existing apps can opt in by adding LD_PRELOAD with the value libjemalloc.so.2 on the app's Environment Variables page. It takes effect on the next deploy or restart.
  • New apps can opt out by deleting the variable.
  • Docker apps are unaffected. The Dockerfile owns the container environment, and Rails' default Dockerfile already sets jemalloc up.

The library is already installed on every Hatchbox server, so there's nothing to provision.