chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] set-finalizer! and cons


From: felix winkelmann
Subject: Re: [Chicken-users] set-finalizer! and cons
Date: Mon, 23 Jan 2006 09:53:18 +0100

On 1/23/06, Zbigniew <address@hidden> wrote:
> Sorry if I'm being dense---why does it need to release any finalizers
> at all, if the pending buffer is totally empty?  I thought the size of
> the pending buffer was the issue here.
>

It's me who is dense, I guess - even if the pending buffer is empty we
force a GC in the hope of filling up the buffer, so that we can then run
the finalizers. It's likely that I'm overlooking the obvious, but the main
problem as it appears to me is that we should avoid registering
finalizers, once the live count goes above the pending buffer size.
Otherwise we have more live finalizers that may be reclaimed in one
go, which would result in a space leak in tight loops. I tested this
with the numbers egg, doing bignum calculations in a loop, and
getting it to work without leaking space (by forcing finalization through
repeated GC) was a major piece of work. The mechanism used is
likely to be suboptimal, but I haven't found a perfect solution yet.
Any suggestions are of course welcome.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]