>>>>> "J" == Jonas Pfenniger <zimbatm / oree.ch> writes:

J> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/15068 - A
J> memleak bug. I couldn't come up with a patch but the participating
J> people on the ticket went pretty far. I hoped somebody more versed
J> into the MRI internals could provide the final help. It is related to
J> automatically published local vars on regexp for example. If you have
J> some and no other local vars, they don't get collected.

 Well, you have found the bug : it's completely described on rubyforge.

 You must have no local variable and ruby must call rb_backref_set() which
 will call top_local_setup() which allocate some memory. You can see it only
 because ruby call top_local_setup() for each method call. It will be
 called only once if the method has some local variable. 

 This memory is never freed because there is the change
 ruby-cvs:17330. When ruby try to free the memory it test against 0 (old
 value) rather against the new value introduced by ruby-cvs:17330.


Guy Decoux