{"id":13880575,"url":"https://github.com/gaffneyc/heroku-buildpack-jemalloc","last_synced_at":"2025-07-16T17:30:40.702Z","repository":{"id":43777520,"uuid":"113065003","full_name":"gaffneyc/heroku-buildpack-jemalloc","owner":"gaffneyc","description":"Heroku buildpack that installs the Jemalloc memory allocator","archived":false,"fork":true,"pushed_at":"2024-08-22T02:49:27.000Z","size":46,"stargazers_count":252,"open_issues_count":4,"forks_count":77,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-24T09:34:00.235Z","etag":null,"topics":["heroku","heroku-buildpack","jemalloc","performance","ruby"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mojodna/heroku-buildpack-jemalloc","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaffneyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-04T16:12:47.000Z","updated_at":"2024-11-19T23:21:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gaffneyc/heroku-buildpack-jemalloc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gaffneyc/heroku-buildpack-jemalloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaffneyc%2Fheroku-buildpack-jemalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaffneyc%2Fheroku-buildpack-jemalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaffneyc%2Fheroku-buildpack-jemalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaffneyc%2Fheroku-buildpack-jemalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaffneyc","download_url":"https://codeload.github.com/gaffneyc/heroku-buildpack-jemalloc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaffneyc%2Fheroku-buildpack-jemalloc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265527541,"owners_count":23782480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["heroku","heroku-buildpack","jemalloc","performance","ruby"],"created_at":"2024-08-06T08:03:14.073Z","updated_at":"2025-07-16T17:30:40.438Z","avatar_url":"https://github.com/gaffneyc.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# heroku-buildpack-jemalloc\n\n[jemalloc](http://jemalloc.net/) is a general purpose malloc implementation\nthat works to avoid memory fragmentation in multithreaded applications. This\nbuildpack makes it easy to install and use jemalloc on Heroku and compatible\nplatforms.\n\n## Install\n\n```console\nheroku buildpacks:add --index 1 https://github.com/gaffneyc/heroku-buildpack-jemalloc.git\ngit push heroku master\n```\n\n## Made possible by Dead Man's Snitch\n\nContinued development and support of the jemalloc buildpack is sponsored by\n[Dead Man's Snitch](https://deadmanssnitch.com).\n\nEver been surprised that a critical recurring job was silently failing to run?\nWhether it's backups, cache clearing, sending invoices, or whatever your\napplication depends on, Dead Man's Snitch makes it easy to\n[monitor heroku scheduler](https://deadmanssnitch.com/docs/heroku) tasks or to add\n[cron job monitoring](https://deadmanssnitch.com/docs/cron-job-monitoring) to\nyour other services.\n\nGet started for free today with [Dead Man's Snitch on Heroku](https://elements.heroku.com/addons/deadmanssnitch)\n\n## Usage\n\n### Recommended\n\nSet the JEMALLOC_ENABLED config option to true and jemalloc will be used for\nall commands run inside of your dynos.\n\n```console\nheroku config:set JEMALLOC_ENABLED=true\n```\n\n### Per dyno\n\nTo control when jemalloc is configured on a per dyno basis use\n`jemalloc.sh \u003ccmd\u003e` and ensure that JEMALLOC_ENABLED is unset.\n\nExample Procfile:\n```yaml\nweb: jemalloc.sh bundle exec puma -C config/puma.rb\n```\n\n## Configuration\n\n### JEMALLOC_ENABLED\n\nSet this to true to automatically enable jemalloc.\n\n```console\nheroku config:set JEMALLOC_ENABLED=true\n```\n\nTo disable jemalloc set the option to false. This will cause the application to\nrestart disabling jemalloc.\n\n```console\nheroku config:set JEMALLOC_ENABLED=false\n```\n\n### MALLOC_CONF\n\nWhile jemalloc's default configuration works well in most situations it does\nprovide a set of options to fine tune performance and memory usage. You can\nfind a full list of options [in the jemalloc documentation](https://github.com/jemalloc/jemalloc/blob/dev/TUNING.md).\n\n\n#### Rails\n\nMany Rails applications benefit from a common set of options and the below was\nadded as the default with dockerfile-rails as of Rails 7.1. While this is a\ngood default for most Rails apps it prefers performance over minimal memory\nusage. For more details on each option and other tested configs with different\ntrade offs there is more info [in this gist](https://gist.github.com/jjb/9ff0d3f622c8bbe904fe7a82e35152fc#malloc_conf-options).\n\n```\nheroku config:set MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true\n```\n\n### JEMALLOC_VERSION\n\nSet this to select or pin to a specific version of jemalloc. The default is to\nuse the latest stable version if this is not set. You will receive an error\nmentioning tar if the version does not exist.\n\n**Default**: `5.3.0`\n\n**note:** This setting is only used during slug compilation. Changing it will\nrequire a code change to be deployed in order to take affect.\n\n```console\nheroku config:set JEMALLOC_VERSION=3.6.0\n```\n\n#### Available Versions\n\n| Version                                                          | Released   |\n| ---------------------------------------------------------------- | ---------- |\n| [3.6.0](https://github.com/jemalloc/jemalloc/releases/tag/3.6.0) | 2015-04-15 |\n| [4.0.4](https://github.com/jemalloc/jemalloc/releases/tag/4.0.4) | 2015-10-24 |\n| [4.1.1](https://github.com/jemalloc/jemalloc/releases/tag/4.1.1) | 2016-05-03 |\n| [4.2.1](https://github.com/jemalloc/jemalloc/releases/tag/4.2.1) | 2016-06-08 |\n| [4.3.1](https://github.com/jemalloc/jemalloc/releases/tag/4.3.1) | 2016-11-07 |\n| [4.4.0](https://github.com/jemalloc/jemalloc/releases/tag/4.4.0) | 2016-12-04 |\n| [4.5.0](https://github.com/jemalloc/jemalloc/releases/tag/4.5.0) | 2017-02-28 |\n| [5.0.1](https://github.com/jemalloc/jemalloc/releases/tag/5.0.1) | 2017-07-01 |\n| [5.1.0](https://github.com/jemalloc/jemalloc/releases/tag/5.1.0) | 2018-05-08 |\n| [5.2.0](https://github.com/jemalloc/jemalloc/releases/tag/5.2.0) | 2019-04-02 |\n| [5.2.1](https://github.com/jemalloc/jemalloc/releases/tag/5.2.1) | 2019-08-05 |\n| [5.3.0](https://github.com/jemalloc/jemalloc/releases/tag/5.3.0) | 2022-05-06 |\n\nThe complete and most up to date list of supported versions and stacks is\navailable on the [releases page.](https://github.com/gaffneyc/heroku-buildpack-jemalloc/releases)\n\n## Development\n\nRun `make console` to start up a shell in a test build environment that mimic's\nHeroku's build phase.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaffneyc%2Fheroku-buildpack-jemalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaffneyc%2Fheroku-buildpack-jemalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaffneyc%2Fheroku-buildpack-jemalloc/lists"}