Skip to content

Instantly share code, notes, and snippets.

@mocoso
Created February 17, 2011 08:55
Show Gist options
  • Save mocoso/831330 to your computer and use it in GitHub Desktop.
Save mocoso/831330 to your computer and use it in GitHub Desktop.
Save this to ~/.rvm/hooks/ to tweak the GC (reducing the number of times it runs) for REE under RVM
echo "RVM - using $rvm_ruby_string"
case "$rvm_ruby_string" in
ree*)
export RUBY_GC_MALLOC_LIMIT=50000000
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_HEAP_SLOTS_INCREMENT=500000
echo "Garbage collection tweaked"
;;
*)
unset RUBY_HEAP_MIN_SLOTS RUBY_HEAP_SLOTS_INCREMENT RUBY_HEAP_SLOTS_GROWTH_FACTOR RUBY_GC_MALLOC_LIMIT RUBY_HEAP_FREE_MIN
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment