Python 2.0

Vadim Chugunov chega_ at yahoo.com
Mon May 31 20:06:31 EDT 1999


> I don't get it.  There's no relation between destructors and real
> garbage collection.  For example, Java uses destructors called
> finalizers, even though most Java VM use real GC.

Right, but java finalizers will not be called till the moment the memory is
collected.
Depending on the GC configuration and the program's memory consumption this
may be quite a while.

> I hate ref counting.  It is memory-leak prone, does not reclaim cyclic
> data without explicit cycle-cut.  I know, by ref counting, object is
> recycled as soon as it looses last reference to it, but relying on
> that behavior is error prone, I think.

Can you explain exactly why is it more error prone?
If something can be done automatically, without writing explicit
deallocation code,
why can't we let it be that way?

I think it all comes to the fact, that some people value the predictability
of the destructor calls over
the ability to reclaim cyclic references, while others feel the other way
round.

OK, I'll try to propose something constructive. Maybe we need an object
protocol, that would enumerate
all references held by an object ?  Writing a portable GC would be then much
easier.

Vadim







More information about the Python-list mailing list