Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using jemalloc flag in our bundle Ruby version #5382

Open
bosawt opened this issue Nov 23, 2020 · 1 comment
Open

Using jemalloc flag in our bundle Ruby version #5382

bosawt opened this issue Nov 23, 2020 · 1 comment

Comments

@bosawt
Copy link
Contributor

bosawt commented Nov 23, 2020

I haven't personally seen the memory footprint of our existing application, but I noticed we weren't using jemalloc flag in our version of Ruby.
( How do I know? If you try this one liner bundle exec ruby -r rbconfig -e "puts RbConfig::CONFIG['MAINLIBS']", you should see -ljemalloc as a config option)

jemalloc is an alternate implementation of the underlying malloc memory allocation function that Ruby uses, and it tends to work quite well with monolith application implementations. I've personally used it on two monoliths and seen dramatic memory footprint reductions, and no downsides. Here is an article describing someone's experience adding it, with a couple tasty graphs:
https://medium.com/rubyinside/how-we-halved-our-memory-consumption-in-rails-with-jemalloc-86afa4e54aa3

If you need further proof, Mike Perham himself tried to make this default in Ruby:
https://bugs.ruby-lang.org/issues/14718
Looks like they were close to adding this into the default, but so far have not agreed on implementing it since it will effect such a wide range of machines. Shouldn't be an issue on our end, especially if we test it properly beforehand.

@f1337
Copy link
Contributor

f1337 commented Dec 9, 2020

Thank you! I have no objections, but we should definitely make sure let operations know when we're ready to merge, just in case they see anything weird pop up in their logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants