Python 2.0

Graham Matthews graham at sloth.math.uga.edu
Wed Jun 2 20:47:42 EDT 1999


graham at sloth.math.uga.edu (Graham Matthews) writes:
| You seem to believe that garbage collection implies no reference counts.
| Why do you believe that? (a lot of GC schemes use reference counts).
| You also seem to believe that with GC finalisation will disappear. Why
| do you believe that (a lot of GC schemes have finalisation).
Donn Cave (donn at u.washington.edu) wrote:
: Does JPython use reference counts, and invoke delete methods as soon as
: reference count drops to 0?

I don't think reference counting garbage collection is mandated in Java 
(it used to be but I think that has changed). 

But I am not sure I see what the connection is between how JPython does 
memory management and garbage collection in Python in general. 

graham at sloth.math.uga.edu (Graham Matthews) writes:
: | ... Finally I
: | believe you are mis-using finalisation if you use it to close up files,
: | sockets, etc. That's what close calls are for.
Donn Cave (donn at u.washington.edu) wrote:
: Well, I think there's something to be said for it.  With Python, we're
: free from the obnoxious requirement imposed by the storage model of
: languages like C, that forces the programmer to account for each scrap
: of malloc'd memory lest there be leaks.  
: ... 
: Why should I enjoy this freedom with memory resources, but welcome exactly
: the same constraints when an object has other termination requirements?

Because other kinds of objects are different to memory? Also I am not
sure why you think GC can't handle other kinds of objects as well. Maybe
Java doesn't do a good job of resource finalisation, but that doesn't
mean it can't be done.

graham

-- 
       Bang, bang, Maxwell's silver hammer came down on her head
    Bang, bang, Maxwell's silver hammer made sure that she was dead




More information about the Python-list mailing list