Interesting. Does this patch fixes it?

Index: hash.c
===================================================================
RCS file: /src/ruby/hash.c,v
retrieving revision 1.128.2.16
diff -u -r1.128.2.16 hash.c
--- hash.c      6 Jul 2006 15:44:26 -0000       1.128.2.16
+++ hash.c      29 Aug 2006 00:14:17 -0000
@@ -328,6 +328,7 @@
        hash = hash_alloc(klass);

        RHASH(hash)->ifnone = Qnil;
+       st_free_table(RHASH(hash)->tbl);
        RHASH(hash)->tbl = st_copy(RHASH(argv[0])->tbl);

        return hash;


On 8/28/06, khaines / enigo.com <khaines / enigo.com> wrote:
> Make a hash:
>
> h = {'a' => 1, 'b' => 2, 'c' => 3}
>
> And make another out of it:
>
> Hash[h]
>
> Do that a lot.  Watch RAM vanish.  GC cleans up the objects out of object
> space just fine, but RAM trickles away nonetheless.
>
> Here is a test program:
>
> loop do
>    attrs = Hash['this','that','the other','enough','stuff','for six']
>    Hash[attrs]
> end
>
> I have tested it on an installation of RedHat Enterprise Linux with 1.8.1,
> 1.8.2, 1.8.4, and 1.8.5 and also under 1.8.4 (one click installer) on
> WinXP Home.
>
> I've ran it under valgrind and just straight, and have inserted code to
> run GC after each loop iteration.  The behavior is consistent.  If you
> eliminate the Hash[attrs] line, there is no leak.
>
>
> Kirk Haines
>
>


-- 
Kent
---
http://www.datanoise.com