JĂșlio Dinis Silva writes:
.... Another thing I done was to track down code which create objects and dont implement nothing to delete them from memory. The tipical error is, for instance, when you in a external method do something like:
----------------
file = open('BIG','r') buffer = file.read(4000000)
[... execute some code with buffer ...]
del buffer return something
----------------
Most people forget the "del buffer" part. This is not necessary in Python.
Python has his own integrated garbage collector (based on reference counts). It detects cases as above and automatically cleans up local variables at function exit. However, cyclic references (direct or indirect) let this collector fails. The new (Python 2.0 and up) garbage collector can handle most (but not all) cyclic garbage as well. Dieter