[前][次][番号順一覧][スレッド一覧]

ruby-changes:30197

From: naruse <ko1@a...>
Date: Tue, 30 Jul 2013 15:52:58 +0900 (JST)
Subject: [ruby-changes:30197] naruse:r42249 (trunk): Show ObjectSpace.count_objects to debug NoMemoryError

naruse	2013-07-30 15:52:48 +0900 (Tue, 30 Jul 2013)

  New Revision: 42249

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42249

  Log:
    Show ObjectSpace.count_objects to debug NoMemoryError

  Modified files:
    trunk/test/runner.rb

Index: test/runner.rb
===================================================================
--- test/runner.rb	(revision 42248)
+++ test/runner.rb	(revision 42249)
@@ -26,4 +26,15 @@ module Test::Unit https://github.com/ruby/ruby/blob/trunk/test/runner.rb#L26
   end
 end
 
-exit Test::Unit::AutoRunner.run(true, src_testdir)
+begin
+  require 'objspace'
+  h = {}
+  raise
+  exit Test::Unit::AutoRunner.run(true, src_testdir)
+rescue
+  ObjectSpace.count_objects(h)
+  p h
+  ObjectSpace.count_objects_size(h)
+  p h
+  raise
+end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]