Skip to content

Instantly share code, notes, and snippets.

@mperham
Last active August 29, 2015 14:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperham/09b0d435c708dd0ddcbb to your computer and use it in GitHub Desktop.
Save mperham/09b0d435c708dd0ddcbb to your computer and use it in GitHub Desktop.
Ruby 2.1.2 memory bloat/leak
> pp ENV.select {|x| x =~ /^RUBY/ }
{"RUBY_GC_HEAP_GROWTH_FACTOR"=>"1.3",
"RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR"=>"1.3",
"RUBY_GC_HEAP_INIT_SLOTS"=>"600000",
"RUBY_GC_MALLOC_LIMIT"=>"90000000",
"RUBYOPT"=>"-rbundler/setup",
"RUBYLIB"=>
"/usr/local/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib"}
We have serious memory bloat/leakage in our production daemons. Sidekiq starts around
250MB and balloons up to 2GB over the course of 12-24 hours. Puma starts a master and
10 workers, starting about 3GB total, before ballooning up to 30GB over the course of
12-24 hours.
@zzak
Copy link

zzak commented May 27, 2014

Here's a list of GC params available in 2.1: https://github.com/ruby/ruby/blob/ruby_2_1/gc.c#L5691-L5720

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