Suitability for long-running text processing?

tsuraan tsuraan at gmail.com
Mon Jan 8 11:13:42 EST 2007


> 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070108/634808c4/attachment.html>


More information about the Python-list mailing list