Skip to content

Instantly share code, notes, and snippets.

@hone
Last active August 29, 2015 14:06
Show Gist options
  • Save hone/a7864a7012dd23a42787 to your computer and use it in GitHub Desktop.
Save hone/a7864a7012dd23a42787 to your computer and use it in GitHub Desktop.
A Call For Help: Testing Changes to Ruby 2.1.x's GC

A Call For Help: Testing Changes to Ruby 2.1.x's GC

Backstory

There's been some known memory issues when upgrading from Ruby 2.0.0 to Ruby 2.1. Ruby 2.1 introduced a new garbage collector (GC), RGenGC, to improve performance. It traded more memory use for speed. The new GC does less aggressive memory clearing. Doing less work means it's faster.

This sounds great, but on lower memory instances it became an issue since there is less memory available to trade. This patch had been applied to Ruby 2.1 and the hopes are it will solve this [issue](https://bugs.ruby-lang.org/issues/ 9607#note-11). By introducing more frequent GC runs, it will reduce the amount of memory being used.

Great, How Can I Help?

@_ko1's patch has already been merged into the Ruby 2.1 branch and queued to be released in Ruby 2.1.3. We (Heroku & ruby-core) would like help verifying this solves the issue at hand with real app data out there.

I've gone ahead and compiled this on Heroku, so it's dead simple to test it. You can run on this newer version of Ruby 2.1.2 by setting this in your Gemfile:

ruby "2.1.2", :patchlevel => "216"

Then after you simply need to deploy this change:

$ git add Gemfile
$ git commit -m "testing Ruby 2.1.2p216"
$ git push heroku master

Would you be willing to try this and let us know if it helps with the memory problem?

Once you have data, can you send me a quick note with your results and how it worked out for you: [email protected].

-Terence (@hone02)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment