From: matz@... (Yukihiro Matsumoto) Date: 2001-12-21T15:57:16+09:00 Subject: [ruby-talk:29203] Re: Constant loss of memory with Kernel::load in a loop Hi, In message "[ruby-talk:29161] Re: Constant loss of memory with Kernel::load in a loop" on 01/12/21, nobu.nokada@softhome.net writes: |Christian Boos wrote: |> The original problem iirc was about repetitively loading the same file |> over and over again. |> If one refers to the "intern"ed version of that filename, wouldn't it |> always refer to the same string? | |Yes. It's similar to my proposal except using a particular |table instead of one for Symbol. [ruby-talk:28803]? I don't think so. Your patch scans filename strings. It's complete, but slow. Christensen's proposal is cheaper. But I'm not sure if it's effective enough. For example, it does not prevent leaks like: loop {|i| fn = format("/tmp/%d.rb", i) f = open(fn, "w") load fn File.unlink fn } I think [ruby-talk:28803] works well for this case too. matz.