garbage colllector

Alberto Vera avera at coes.org.pe
Tue Nov 4 19:01:31 EST 2003


Hello:
I'd like to try the use of garbage collector, so I wrote these lines to do it(*), but if I delete lines related to garbage collector this works similar as it didn't have

Do you know another way to try the use of garbage collector?

Thanks 

(*)
import gc

gw_was_enabled= gc.isenabled()
if gw_was_enabled:
    gc.collect()    
else:    
    gc.enable()

t=0
while 1<2:

 gc.collect()    
 MyDict2 = {}
 MyDict2['x']="122222222222222222222222222.3333333333333333333333333333"
 MyDict2['Y']="2.24233333333333333333333333333333333332"
 
 t+=1

 localtime = time.localtime()
 print str(t)+"     "+str(time.strftime('%Y-%m-%d %H:%M:%S', localtime))
 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20031104/d6a60a0d/attachment.html>


More information about the Python-list mailing list