Debug IRB session

Hi,

Recently IRB has been leaking memory until it consumes all I have
available(8GB).
I can’t figure out why - I don’t use anything other than the core
classes, and the odd time classes in Standard Library. During my last
IRB session, i used the core classes as well as requiring ‘time’ to
utilize Time.parse()

Beforehand, it was just the core classes.

My .irbrc:

== Bench

Quickly benchmark ruby enclosed inside a block.

require ‘benchmark’
def bench &blk
Benchmark.bm do |r|
r.report &blk
end
end

uname -a:
Linux myhost 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:01:40 CET 2009
x86_64 AMD Phenom™ 9600 Quad-Core Processor AuthenticAMD GNU/Linux

Is there anything I can do to debug the problem so I can file a bug
report & hopefully fix the issue?

Oops, forgot to mention my ruby version:
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

Robert G. wrote:

Hi,

Recently IRB has been leaking memory until it consumes all I have
available(8GB).

Is there anything I can do to debug the problem so I can file a bug
report & hopefully fix the issue?

http://timetobleed.com/memprof-a-ruby-level-memory-profiler/
valgrind
come to mind.

Unfortunately that’s for 1.8.7 only. I could hack you up a version of
1.9 that has something like

GC.each_object{|o|

o.where_created
=> [filename, line]
}

if desired for profiling purposes.

-r