From 2c0d74b7085edba6557b32a3f48ef8a03d194eb4 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 27 Sep 2013 09:36:48 +0000 Subject: * gc.c: add two GC tuning environment variables. RUBY_GC_MALLOC_LIMIT_MAX and RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR. See r43067 for details. * gc.c (rb_gc_set_params): refactoring. And change verbose notation. Mostly duplicated functions get_envparam_int/double is not cool. Please rewrite it. * test/ruby/test_gc.rb: fix a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index b1e52fc58e..53fd107747 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -113,13 +113,23 @@ class TestGc < Test::Unit::TestCase assert_in_out_err([env, "-e", "exit"], "", [], [], "[ruby-core:39795]") assert_in_out_err([env, "-W0", "-e", "exit"], "", [], [], "[ruby-core:39795]") assert_in_out_err([env, "-W1", "-e", "exit"], "", [], [], "[ruby-core:39795]") - assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /HEAP_MIN_SLOTS=100000/, "[ruby-core:39795]") env = { "RUBY_HEAP_SLOTS_GROWTH_FACTOR" => "2.0" } assert_normal_exit("exit", "", :child_env => env) - assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_slots_growth_factor=2.0/, "") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /HEAP_SLOTS_GROWTH_FACTOR=2.0/, "") + + env = { + "RUBY_GC_MALLOC_LIMIT" => "60000000", + "RUBY_GC_MALLOC_LIMIT_MAX" => "160000000", + "RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR" => "2.0" + } + assert_normal_exit("exit", "", :child_env => env) + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /RUBY_GC_MALLOC_LIMIT=6000000/, "") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /RUBY_GC_MALLOC_LIMIT_MAX=16000000/, "") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR=2.0/, "") end def test_profiler_enabled -- cgit v1.2.3