# Debug IRB session

**URL:** <https://www.ruby-forum.com/t/debug-irb-session/180222>\
**Category:** Ruby\
**Created:** [December 15, 2009, 5:12am UTC](https://www.ruby-forum.com/t/debug-irb-session/180222 "2009-12-15T05:12:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sovok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sovok](https://www.ruby-forum.com/u/sovok)\
**Post date:** [December 15, 2009, 5:12am UTC](https://www.ruby-forum.com/t/debug-irb-session/180222/1 "2009-12-15T05:12:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sovok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sovok](https://www.ruby-forum.com/u/sovok)\
**Post date:** [December 15, 2009, 5:13am UTC](https://www.ruby-forum.com/t/debug-irb-session/180222/2 "2009-12-15T05:13:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sovok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5a626/32.png) [@sovok](https://www.ruby-forum.com/u/sovok)\
**Post date:** [December 15, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/debug-irb-session/180222/3 "2009-12-15T16:20:12Z")

</div>

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/](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
