On Fri, 24 Aug 2007 19:44:37 +0800, Yan Zhu wrote:

> Here is 3 PYs, we found there is a big memory wasting, specially the program
> c.py, we found the memory will increase very soon.
> any body knows why? any RC's problem? thanks

You are creating reference cycles and instantiate many in very short time.
Objects with cyclic dependencies must be detected by the garbage collector
which takes some time.

Usually this is not a problem because generating lots of cycles in a tight
and endless ``while``-loop is not *that* common.  ;-)

You may take a look into the `weakref` module to avoid the cycles.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to