garbage collector

Tim Peters at
Thu Jul 26 23:52:48 EDT 2001

[franck delarue]
> I use python1 with a lot of object (dictionnairies +
> lists) and my program takes 3 or 4 hours to execute on
> a 4 processors (700 mghz) and 2 Go Ram machine (linux
> red hat).
> The problem is that when the program is finished,
> python still continues to delete the objects (I've put
> some "print" to see when the "del" function is
> executed) during about 30 minutes.
> Is that normal ?

For your particular app as currently written, apparently "yes".  It's
unusual in general, but common enough for apps that greatly exceed VM -- it
can take a very long time at shutdown to page in all the objects again to
decrement their refcounts.

> Is there a solution to stop the program correctly ?
> ("ctrl+alt+del" or "kill -9 XXX" works but i don't feel satisfied)

You can use os._exit() (note:  not the same as sys.exit()) if you don't care
about clean-up handling.  That's extreme, though.

More information about the Python-list mailing list