Python vs Java garbage collection?

Tim Peters tim.one at comcast.net
Fri Dec 27 17:25:36 EST 2002


[Martin v. Löwis]
> ...
> The often-cited statement in the language reference with regard to
> refcounting came precisely out of the Jython development, and is there
> to support Jython only.

Guido isn't *that* reactive <wink>.  If you look at rev 1.1 of ref3.tex,
you'll see that the following paragraph was in the Language Reference manual
in 1992 (at least -- IIRC, the ref man was maintained in FrameMaker before
1992, and CVS doesn't have any history for that):

    Objects are never explicitly destroyed; however, when they become
    unreachable they may be garbage-collected.  An implementation is
    allowed to delay garbage collection or omit it altogether --- it is
    a matter of implementation quality how garbage collection is
    implemented, as long as no objects are collected that are still
    reachable.  (Implementation note: the current implementation uses a
    reference-counting scheme which collects most objects as soon as
    they become unreachable, but never collects garbage containing
    circular references.)

The only thing that changed here in 10+ years is that the implementation
note changed a little, to remark that cyclic garbage can be reclaimed now in
CPython.  Guido was always explicit about that refcounting was simply an
implementation choice, not part of the language definition.  Java didn't
exist when this was first written, although Jython may have <wink>.






More information about the Python-list mailing list