From: Michael Neumann Date: 2001-12-17T19:51:55+09:00 Subject: [ruby-talk:28750] Re: Constant loss of memory with Kernel::load in a loop Jens Nissen wrote: > #demo.rb > counter = 0 > while TRUE > counter = counter + 1 > load "loadit.rb" > puts "Round #{counter}" if (counter.modulo(100) == 0) > GC.start if (counter.modulo(500) == 0) > end > #end of demo.rb > > #loadit.rb > def foo(x) > x = x + 1 > end > > foo(1) > > #end of loadit.rb > > Does anybody have an idea where the memory goes away? > How can I work around this? I don't know, but maybe it's the method you declare in loadit.rb? Does Ruby free overwritten methods? To make this sure, simply load an empty file in the while-loop and test again. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de