[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weak pointers
Quoting Eli Barzilay:
> Just curious -- is this problem:
>
> A tight loop creating weak hash table entries or wills can
> accumulate memory indefinitely
>
> partially solved? I tried a tight loop for more than six hours and it
> did accumulate memory, but at a very slow rate that seemed to be
> bounded because the growth rate was getting slower over time (that's
> in v.101).
It hasn't been fixed. On my machine, the program
(define w (make-hash-table-weak))
(let loop ()
(hash-table-put! w (cons 1 2) 7)
(loop))
grows the heap to 10 MB in a few seconds. It grows more slowly after
that, but I don't think it should grow to 10 MB in the first place.
One reason I haven't worked on the problem is that I expected it to be
easier to fix in 2k (with precise collection), and I thought 2k was
just around the corner. But it looks like it will be a while before 2k
is ready for general use, so I'll take another look at the problem.
Matthew