3 ms·
Perl also uses reference counting, and cyclical data structures cause memory leaks unless you explicitly decrease the reference count with the weaken function f
by zerohp 16y ago
Perl also uses reference counting, and cyclical data structures cause memory leaks unless you explicitly decrease the reference count with the weaken function from Scalar::Util.
- IgorPartola 16y agoAnd Python. AFAIK, there are no plans to fix it at this point. Also Python is notorious for allocating lots of small objects.
- LeonidasXIV 16y agoThough it does throw away unused cyclic dependencies, so you don't have to do the same trickery as in Perl.
- stonemetal 16y agoPython has a mark and sweep garbage collector(since 2.0) to catch that which reference counting misses. You can disable it if you know you don't make any cyclical objects.
- pnathan 16y agoI've done minor amounts of text analysis in Python. It is a memory pig. I was shocked. Anything remotely like a non-trivial dataset should not be run in pure Python, based on my experience.