This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gtang
Recipients gtang
Date 2008-06-08.15:46:00
SpamBayes Score 0.02918027
Marked as misclassified No
Message-id <1212939967.99.0.941797469942.issue3063@psf.upfronthosting.co.za>
In-reply-to
Content
#the following code consume about 800M memory, which is normal
n = 100000000
data = [0.0 for i in xrange(n)]

#however, if I assign random number to data list, it will consume extra 
2.5G memory.
from random import random
for s in xrange(n):
    data[i] = random()

#even if I delete data, only 800M memory released
del data

#call gc.collect() does not help, the extra 2.5G memory not released
import gc
gc.collect()

only when I quit Python, the memory is released. Same effect if I use 
random number generator from numpy. 
Same effect even if I just say data[i] = atpof("1.26")
I tried it in both Python 2.4 and 2.5 on linux 64bit and 32bit.
History
Date User Action Args
2008-06-08 15:46:09gtangsetspambayes_score: 0.0291803 -> 0.02918027
recipients: + gtang
2008-06-08 15:46:09gtangsetspambayes_score: 0.0291803 -> 0.0291803
messageid: <1212939967.99.0.941797469942.issue3063@psf.upfronthosting.co.za>
2008-06-08 15:46:06gtanglinkissue3063 messages
2008-06-08 15:46:04gtangcreate