Queue cleanup

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Mon Aug 30 04:23:00 EDT 2010


In message <7x39twpuxi.fsf at ruckus.brouhaha.com>, Paul Rubin wrote:

> Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> writes:
>
>>> the CPython API means endlessly finding and fixing refcount bugs that
>>> lead to either crashes/security failures, or memory leaks.
>>
>> I don’t see why that should be so. It seems a very simple discipline to
>> follow: initialize, allocate, free. Here’s an example snippet from my DVD
>> Menu Animator <http://github.com/ldo/dvd_menu_animator>:
> 
> In practice it has been a problem.

Maybe people need to learn to write code in a more structured fashion.

> If it hasn't happened to you yet, you're either burning a bunch of effort
> that programmers of more automatic systems can put to more productive
> uses ...

What makes you say that? Avoiding bugs is not a “productive use”?

>> And how do you run such an application? You have to limit it to a
>> predetermined amount of memory to begin with, otherwise it would easily
>> gobble up everything you have.
> 
> No that's usually not a problem-- the runtime system (generational gc)
> can figure out enough from your allocation pattern to prevent the heap
> from getting overlarge.

And yet Java apps, for example, are (in)famous for excessive memory usage 
compared to those written in non-GC-dependent languages.



More information about the Python-list mailing list