Memory Leakage with Tuples and Lists

Robin Becker robin at jessikat.fsnet.co.uk
Sat Jan 6 05:53:42 EST 2001


In article <936h6e$d11$1 at news.nuri.net>, June Kim <junaftnoon at nospamplzy
ahoo.com> writes
>Tested under Python 1.5 and 2.0 on Win32:
>
>1.
>Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)
>Type "copyright", "credits" or "license" for more informat
>>>> for j in range(10):
>...     temp=range(800000)
>...     del temp
>
>2.
>Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)
>Type "copyright", "credits" or "license" for more informat
>>>> for j in range(10):
>...     temp='a'*8000000
>...     del temp
>
>In the case of #2, there is no memory leakage at all. All the memory is
>returned 100%. However, in #1, there is a severe memory leakage, a few mega
>bytes. Do you guys experience this on *nices as well?
>
>
I don't see the leak you describe; how did you check for it? Certainly
the total memory used grows the first time I use the code; after all
800000 ints is 3.2M; if there a serious leak I would expect to see
around 32M disappear each time I run the code. I certainly don't see
that.
-- 
Robin Becker



More information about the Python-list mailing list