From 5ddcd30e75e9cb8e88fdfb41dd7aa234135c4202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lourens=20Naud=C3=A9?= Date: Wed, 3 Dec 2014 15:11:03 +0000 Subject: [PATCH] Introduce support for other tuneable GC vars --- script/bench.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/script/bench.rb b/script/bench.rb index 46720b83f..216b60cf6 100644 --- a/script/bench.rb +++ b/script/bench.rb @@ -102,16 +102,18 @@ end ENV["RAILS_ENV"] = "profile" +gc_env_vars = %w(RUBY_GC_HEAP_INIT_SLOTS RUBY_GC_HEAP_FREE_SLOTS RUBY_GC_HEAP_GROWTH_FACTOR RUBY_GC_HEAP_GROWTH_MAX_SLOTS RUBY_GC_MALLOC_LIMIT RUBY_GC_OLDMALLOC_LIMIT RUBY_GC_MALLOC_LIMIT_MAX RUBY_GC_OLDMALLOC_LIMIT_MAX RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR) + if @include_env puts "Running with tuned environment" ENV["RUBY_GC_MALLOC_LIMIT"] = "50_000_000" - ENV.delete "RUBY_HEAP_SLOTS_GROWTH_FACTOR" - ENV.delete "RUBY_HEAP_MIN_SLOTS" - ENV.delete "RUBY_FREE_MIN" + gc_env_vars - %w(RUBY_GC_MALLOC_LIMIT).each do |v| + ENV.delete v + end else # clean env puts "Running with the following custom environment" - %w{RUBY_GC_MALLOC_LIMIT RUBY_HEAP_MIN_SLOTS RUBY_FREE_MIN}.each do |w| + gc_env_vars.each do |w| puts "#{w}: #{ENV[w]}" end end