471,353 Members | 1,686 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

any problem with py's RC?

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

--
eSX

Aug 24 '07 #1
1 813
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
Aug 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by ex laguna | last post: by
reply views Thread by ex laguna | last post: by
8 posts views Thread by David S. | last post: by
reply views Thread by Pieter Edelman | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.