Tracking memory usage and object life time.

Istvan Albert istvan.albert at gmail.com
Wed Sep 26 10:28:09 EDT 2007


On Sep 26, 8:06 am, Berteun Damman <bert... at gmail.com> wrote:

> that have been created after I don't need them anymore. I furthermore
> don't really see why there would be references to these larger objects
> left. (I can be mistaken of course).

This could be tricky because you have a graph that (probably) allows
you to walk its nodes, thus even having a single other reference to
any of the nodes could keep the entire graph "alive"

> The best I now can do is run the whole script several times (from a
> shell script) -- but this also forces Python to reparse the graph
> input again, and do some other stuff it only has to do once. A

you could pickle and save the graph once the initial processing is
done. That way subsequent runs will load substantially faster.

i.




More information about the Python-list mailing list