Created
January 20, 2011 21:16
-
-
Save benders/788695 to your computer and use it in GitHub Desktop.
Rake task to set GC params before running tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :test do | |
desc "Tune GC environment variables for test running" | |
task :gc do | |
# Requires REE or a Ruby patched to allow GC tuning | |
# Credit to Darren Boyd at ZenDesk for the settings | |
ENV['RUBY_HEAP_MIN_SLOTS']='500000' | |
ENV['RUBY_HEAP_SLOTS_INCREMENT']='500000' | |
ENV['RUBY_HEAP_SLOTS_GROWTH_FACTOR']='1' | |
ENV['RUBY_GC_MALLOC_LIMIT']='100000000' | |
ENV['RUBY_HEAP_FREE_MIN']='500000' | |
end | |
end | |
# Hook the GC task before the common db prep prereq for all tests | |
Rake::Task['db:test:prepare'].enhance ['test:gc'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment