gaffneyc / heroku-buildpack-jemalloc

Heroku buildpack that installs the Jemalloc memory allocator
BSD 3-Clause "New" or "Revised" License
252 stars 77 forks source link

Jemalloc no longer working #25

Closed itay-grudev closed 3 years ago

itay-grudev commented 3 years ago

I am not sure why, but my memory usage exploded a while ago and from what I can tell jemalloc is no longer working. No action was performed on our side.

Here are some excerpts from my configuration:

> heroku run bash
> ruby -r rbconfig -e "puts RbConfig::CONFIG['MAINLIBS']"
-lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm
> jemalloc.sh ruby -r rbconfig -e "puts RbConfig::CONFIG['MAINLIBS']"
-lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm
> heroku config:get JEMALLOC_ENABLED
true

image

gaffneyc commented 3 years ago

@itay-grudev There isn't a good way to see if jemalloc is enabled through RbConfig or inside a process. The best way at the moment (which needs to be added to the readme) is this: https://github.com/gaffneyc/heroku-buildpack-jemalloc/issues/5#issuecomment-499932026

Give that a try and let me know if it's not actually enabled. Jemalloc's allocation algorithm does a better job of allocating objects in already claimed free memory rather than requesting more from the system so it's possible there is a change in your app which is causing it to request and retain a lot more memory

itay-grudev commented 3 years ago

You are correct. It seems to be enabled using this way of testing. I will investigate alternative routes. Thank you.

P.S. Could you please document this: MALLOC_CONF=stats_print:true ruby -e "exit"