I just tried on my system

(Python is using 2.9 MiB)
>>> a = ['a' * (1 << 20) for i in xrange(300)]
(Python is using 304.1 MiB)
>>> del a
(Python is using 2.9 MiB -- as before)

And I didn't even need to tell the garbage collector to do its job. Some
info:


It looks like the big difference between our two programs is that you have
one huge string repeated 300 times, whereas I have thousands of
four-character strings.  Are small strings ever collected by python?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to