Deleting objects on the fly

Michele Simionato michele.simionato at gmail.com
Fri Aug 10 01:26:11 EDT 2007


On Aug 10, 2:25 am, Godzilla <godzillais... at gmail.com> wrote:
> Hello,
>
> I wish to know whether I should delete objects created on the fly via
> the "del obj" statement. I noticed the RAM usage increased whenever
> the application is being run for a long time. I am creating lots of
> objects (messages) on the fly for communication between threads.
>
> Rather than having python's gc to do the work, does it make a
> difference if I force a deletion?
>
> Thanks.

Probably not, 'del x' just decrements the reference count, but
it is the gc who does the real job. See http://docs.python.org/ref/customization.html#l2h-175

Do you have reference cycles in your application? You should
tell us something more.

       Michele Simionato




More information about the Python-list mailing list