Python vs Java garbage collection?

maney at pobox.com maney at pobox.com
Sat Dec 28 00:23:02 EST 2002


Skip Montanaro <skip at pobox.com> wrote:
> 
>    >>> It seems to me that it would most likely be a reference count.  
>    >> But that would slow down assignments and parameter passing in
>    Martin> Yes, I assumed that that was at least a good part of the reason
>    Martin> Jython abandonded the traditional ref counting of CPython.  
> 
> Not at all.  Jython didn't abandon reference counting.  It wasn't an option.

I'm not sure if we disagree about more than word choices, because the
next bit is oddly difficult to digest:

> Jython compiles Python code to JVM bytecode, which is what implements the
> garbage collection.  In CPython, the C code which makes up the PyVM
> implements reference counting.

Is the assymetry between "JVM bytecode" and "C code...PyVM"
intentional?  I would have thought that the cases were more
symmetrical, with the Python being compiled to bytecodes and the VMs
running things, including the gc mechanism, whatever it may be.

The way you stated it would be more promising for the sort of hybrid
I suggested, since if the gc is implemented in the generated bytecodes
then it would be easier to change; however, I suspect that it's not
that simple.



More information about the Python-list mailing list