Sujet : Re: The Joy of Python
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacyDate : 17. Apr 2024, 02:59:59
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uvn6uf$17j5g$4@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On 16 Apr 2024 18:42:09 GMT, rbowman wrote:
Of course reference counting never ever goes wrong.
I think the term is “ORC”, for “cycles + reference counting”. Both Perl
and Python do it. The idea is to do reference counting as far as possible,
and only fall back to full-on garbage collection when you hit cases that
need it.
This way, it is fairly easy to write a well-behaved Python program whose
memory usage will stay within reasonable bounds, even after running for a
long time. Unlike Java, for example, which will happily chew up all the
RAM on your system if you let it.
There is a downside, in that maintaining those reference counts reduces
the concurrency when trying to do multithreading. The Python folks have a
solution to that, which will take a bit of work to do correctly, but which
is slowly going in.