any problem with py's RC?

Y

Yan Zhu

hi all,
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
 
M

Marc 'BlackJack' Rintsch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top