From: Jens Nissen Date: 2001-12-17T21:36:57+09:00 Subject: [ruby-talk:28754] Re: Constant loss of memory with Kernel::load in a loop "ts" schrieb im Newsbeitrag news:200112171121.fBHBLo909484@moulon.inra.fr... > >>>>> "J" == Jens Nissen writes: > > J> - in small amounts but constantly, after 2 days around 200 MB. > > Can you try this patch, it's against ruby-1.6.5 to see if it give better > result > I recompiled Ruby 1.6.5. with a modified rb_compile_file, but I can see no difference, the loss of memory remains the same. NODE* rb_compile_file(f, file, start) const char *f; VALUE file; int start; { char *tmp = ALLOCA_N(char, strlen(f) + 1); // +++ lex_gets = rb_io_gets; lex_input = file; lex_pbeg = lex_p = lex_pend = 0; ruby_sourceline = start - 1; strcpy(tmp, f); // +++ return yycompile(tmp, start); // +++ // return yycompile(strdup(f), start); // --- } But your code gives me new ideas where to look. I modified my samples once more, to see, whether the loss already appears during compilation. And the loss also appears in the following situation: # demo-bug.rb counter = 0 while TRUE counter = counter + 1 begin load "loadit-bug.rb" rescue Exception end puts "Round #{counter}" if (counter.modulo(100) == 0) GC.start if (counter.modulo(500) == 0) end # end of demo-bug.rb # loadit-bug.rb rabbel # endof loadit-bug.rb Thanks anyhow, Jens