any problem with py's RC?
Yan Zhu
nayuhz at gmail.com
Fri Aug 24 07:44:37 EDT 2007
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070824/4009665c/attachment.html>
-------------- next part --------------
class a():
def __init__(self):
fp = open("a_file_lager_1M","rb")
self.ll = fp.read()
fp.close()
self.h = b(self.aaa)
def aaa(self):
pass
class b:
def __init__(self,bbb):
self.a = bbb #remove the "self.", the memory use will be very low!
pass
def c():
k=a()
while True:
c()
-------------- next part --------------
import haha
import time
def c():
b=haha.Client(["127.0.0.1"])
while True:
# time.sleep(1)
c()
-------------- next part --------------
#!/usr/bin/env python
from threading import local
class Client(local):
def __init__(self, servers, debug=0):
self.k = [_Host(s, self.debuglog) for s in servers]
def debuglog(self, str):
pass
class _Host:
def __init__(self, host, debugfunc=None):
self.debuglog = debugfunc #a -> b b->a, make the memory be huge!
pass
More information about the Python-list
mailing list