diff options
Diffstat (limited to 'test/ruby/test_gc.rb')
-rw-r--r-- | test/ruby/test_gc.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 53fd107747..30baebb67a 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -70,6 +70,13 @@ class TestGc < Test::Unit::TestCase GC.stat(stat) ObjectSpace.count_objects(count) assert_equal(count[:TOTAL]-count[:FREE], stat[:heap_live_num]) + assert_equal(count[:FREE], stat[:heap_free_num]) + + # measure again without GC.start + 1000.times{ "a" + "b" } + GC.stat(stat) + ObjectSpace.count_objects(count) + assert_equal(count[:FREE], stat[:heap_free_num]) end def test_singleton_method |